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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: F = None
        self.p: B = None
        self.t: D = 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.o: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: F = None
        self.p: B = None
        self.t: D = 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.o: D = None
        self.txt = txt

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

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

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

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