class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.u: D = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.z: E = None
        self.v: B = None
        self.u: E = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.p: F = None
        self.u: B = None
        self.txt = txt

h = A("h")
j = B("j")
f = C("f")
c = D("c")
d = E("d")
k = F("k")
m = F("m")
e = E("e")
b = B("b")

h.w = c
j.r = c
f.w = c
f.u = c
f.r = j
f.t = h
c.w = f
d.y = c
d.q = k
d.z = e
d.u = e
d.v = j
d.t = h
k.r = c
k.q = h
k.p = m
k.u = j
m.r = c
m.q = h
m.p = k
m.u = b
e.y = c
e.q = k
e.z = d
e.u = d
e.v = b
e.t = h
b.r = c
assert f.w.w.u.w.r.r.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.u: D = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.z: E = None
        self.v: B = None
        self.u: E = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.p: F = None
        self.u: B = None
        self.txt = txt

h = A("h")
j = B("j")
f = C("f")
c = D("c")
d = E("d")
k = F("k")
m = F("m")
e = E("e")
b = B("b")

h.w = c
j.r = c
f.w = c
f.u = c
f.r = j
f.t = h
c.w = f
d.y = c
d.q = k
d.z = e
d.u = e
d.v = j
d.t = h
k.r = c
k.q = h
k.p = m
k.u = j
m.r = c
m.q = h
m.p = k
m.u = b
e.y = c
e.q = k
e.z = d
e.u = d
e.v = b
e.t = h
b.r = c
assert f.w.w.u.w.r.r.w.t.txt == "h"