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

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

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

l = A("l")
n = B("n")
d = C("d")
e = C("e")
k = B("k")

l.p = k
l.o = k
l.z = e
n.o = k
d.s = e
d.u = e
e.s = d
e.u = d
k.o = n
assert d.s.s.u.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

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

l = A("l")
n = B("n")
d = C("d")
e = C("e")
k = B("k")

l.p = k
l.o = k
l.z = e
n.o = k
d.s = e
d.u = e
e.s = d
e.u = d
k.o = n
assert d.s.s.u.u.s.txt == "e"