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

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

c = A("c")
l = B("l")
a = A("a")
i = A("i")
h = B("h")
j = A("j")
e = B("e")

c.t = h
c.x = e
l.z = e
l.o = c
a.t = h
a.x = l
i.t = l
i.x = l
h.z = e
h.o = c
j.t = e
j.x = h
e.z = h
e.o = a
assert c.x.z.z.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: B = None
        self.txt = txt

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

c = A("c")
l = B("l")
a = A("a")
i = A("i")
h = B("h")
j = A("j")
e = B("e")

c.t = h
c.x = e
l.z = e
l.o = c
a.t = h
a.x = l
i.t = l
i.x = l
h.z = e
h.o = c
j.t = e
j.x = h
e.z = h
e.o = a
assert c.x.z.z.o.t.txt == "h"