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

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

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

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

d.o = i
d.t = k
e.p = d
e.t = k
e.x = c
i.z = d
i.y = e
l.z = d
l.y = c
k.p = d
k.t = c
k.x = e
b.z = d
b.y = c
c.p = d
c.t = k
c.x = e
n.z = d
n.y = e
assert l.z.o.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: B = None
        self.txt = txt

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

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

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

d.o = i
d.t = k
e.p = d
e.t = k
e.x = c
i.z = d
i.y = e
l.z = d
l.y = c
k.p = d
k.t = c
k.x = e
b.z = d
b.y = c
c.p = d
c.t = k
c.x = e
n.z = d
n.y = e
assert l.z.o.y.t.txt == "k"