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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: B = None
        self.u: D = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

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

d = A("d")
m = B("m")
a = C("a")
f = D("f")
k = E("k")
i = F("i")
j = C("j")
c = B("c")

d.z = i
d.q = j
d.y = c
m.u = d
a.z = j
f.o = c
f.s = c
f.t = j
k.v = j
k.p = j
k.o = m
k.u = f
k.s = d
i.q = k
i.z = j
j.z = a
c.u = d
assert f.t.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: B = None
        self.u: D = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

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

d = A("d")
m = B("m")
a = C("a")
f = D("f")
k = E("k")
i = F("i")
j = C("j")
c = B("c")

d.z = i
d.q = j
d.y = c
m.u = d
a.z = j
f.o = c
f.s = c
f.t = j
k.v = j
k.p = j
k.o = m
k.u = f
k.s = d
i.q = k
i.z = j
j.z = a
c.u = d
assert f.t.z.z.txt == "j"