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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.u: A = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.q: D = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

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

c.u = l
b.z = l
b.x = l
b.t = l
l.x = e
l.y = e
l.u = n
l.t = f
a.t = b
a.x = b
f.u = n
d.y = l
d.u = a
d.q = a
d.w = a
d.p = e
e.z = l
e.x = l
e.t = l
n.u = l
assert d.y.u.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.u: A = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.q: D = None
        self.w: D = None
        self.p: B = None
        self.txt = txt

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

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