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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.s: F = None
        self.u: A = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

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

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

f.t = a
f.z = a
a.y = n
n.t = a
b.y = d
b.u = k
k.z = n
k.r = a
k.s = d
k.u = f
k.v = f
k.x = f
d.y = b
d.q = a
e.y = b
e.q = a
assert n.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.s: F = None
        self.u: A = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

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

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

f.t = a
f.z = a
a.y = n
n.t = a
b.y = d
b.u = k
k.z = n
k.r = a
k.s = d
k.u = f
k.v = f
k.x = f
d.y = b
d.q = a
e.y = b
e.q = a
assert n.t.y.t.txt == "a"