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

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

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

k = A("k")
j = B("j")
d = C("d")
a = A("a")
e = A("e")
i = C("i")
f = C("f")
b = A("b")

k.q = f
k.o = d
k.z = a
j.p = d
d.s = f
d.u = j
a.q = i
a.o = f
a.z = e
e.q = d
e.o = f
e.z = b
i.s = d
i.u = j
f.s = i
f.u = j
b.q = d
b.o = f
b.z = e
assert b.z.o.s.u.p.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: C = None
        self.z: A = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
d = C("d")
a = A("a")
e = A("e")
i = C("i")
f = C("f")
b = A("b")

k.q = f
k.o = d
k.z = a
j.p = d
d.s = f
d.u = j
a.q = i
a.o = f
a.z = e
e.q = d
e.o = f
e.z = b
i.s = d
i.u = j
f.s = i
f.u = j
b.q = d
b.o = f
b.z = e
assert b.z.o.s.u.p.s.s.s.txt == "d"