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

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

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

l = A("l")
i = B("i")
d = C("d")
b = C("b")
a = C("a")
e = A("e")
k = B("k")
m = A("m")

l.p = i
i.z = e
i.t = b
i.s = a
d.o = e
d.z = b
d.u = m
b.o = l
b.z = d
b.u = m
a.o = e
a.z = b
a.u = l
e.p = k
k.z = m
k.t = a
k.s = b
m.p = i
assert b.u.p.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

l = A("l")
i = B("i")
d = C("d")
b = C("b")
a = C("a")
e = A("e")
k = B("k")
m = A("m")

l.p = i
i.z = e
i.t = b
i.s = a
d.o = e
d.z = b
d.u = m
b.o = l
b.z = d
b.u = m
a.o = e
a.z = b
a.u = l
e.p = k
k.z = m
k.t = a
k.s = b
m.p = i
assert b.u.p.s.z.txt == "b"