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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

e = A("e")
b = B("b")
l = C("l")
c = D("c")
k = E("k")
f = F("f")

e.q = b
e.z = l
b.x = e
b.u = k
l.o = k
c.x = k
c.r = f
c.y = f
k.u = l
k.t = e
k.z = f
k.x = f
k.s = b
k.q = b
f.u = b
assert f.u.u.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

e = A("e")
b = B("b")
l = C("l")
c = D("c")
k = E("k")
f = F("f")

e.q = b
e.z = l
b.x = e
b.u = k
l.o = k
c.x = k
c.r = f
c.y = f
k.u = l
k.t = e
k.z = f
k.x = f
k.s = b
k.q = b
f.u = b
assert f.u.u.t.z.txt == "l"