class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: D = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.x: C = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.x: C = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

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

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