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

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

c = A("c")
e = B("e")
f = A("f")
l = B("l")
d = A("d")
i = B("i")
j = B("j")
k = A("k")

c.p = i
c.z = j
e.t = f
e.o = i
f.p = j
f.z = l
l.t = f
l.o = i
d.p = j
d.z = j
i.t = d
i.o = j
j.t = f
j.o = l
k.p = l
k.z = l
assert c.z.t.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: B = None
        self.txt = txt

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

c = A("c")
e = B("e")
f = A("f")
l = B("l")
d = A("d")
i = B("i")
j = B("j")
k = A("k")

c.p = i
c.z = j
e.t = f
e.o = i
f.p = j
f.z = l
l.t = f
l.o = i
d.p = j
d.z = j
i.t = d
i.o = j
j.t = f
j.o = l
k.p = l
k.z = l
assert c.z.t.p.t.txt == "f"