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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: B = None
        self.o: F = None
        self.r: F = None
        self.y: A = None
        self.v: F = None
        self.txt = txt

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

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

j.t = f
b.s = e
m.r = n
e.u = f
e.z = n
e.w = k
n.w = f
n.o = f
n.r = f
n.v = f
n.p = b
n.y = j
f.q = e
f.z = e
f.w = n
f.v = b
k.r = n
assert e.z.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: B = None
        self.o: F = None
        self.r: F = None
        self.y: A = None
        self.v: F = None
        self.txt = txt

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

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

j.t = f
b.s = e
m.r = n
e.u = f
e.z = n
e.w = k
n.w = f
n.o = f
n.r = f
n.v = f
n.p = b
n.y = j
f.q = e
f.z = e
f.w = n
f.v = b
k.r = n
assert e.z.y.t.txt == "f"