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

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

h = A("h")
c = B("c")
m = A("m")
b = A("b")
i = A("i")
k = B("k")
l = A("l")
e = B("e")

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

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

h = A("h")
c = B("c")
m = A("m")
b = A("b")
i = A("i")
k = B("k")
l = A("l")
e = B("e")

h.u = k
h.o = i
c.z = k
c.t = i
m.u = e
m.o = i
b.u = k
b.o = l
i.u = c
i.o = h
k.z = e
k.t = l
l.u = e
l.o = i
e.z = k
e.t = l
assert k.z.z.t.txt == "l"