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

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

i = A("i")
n = B("n")
m = A("m")
a = B("a")
c = B("c")
k = A("k")
l = B("l")

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

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

i = A("i")
n = B("n")
m = A("m")
a = B("a")
c = B("c")
k = A("k")
l = B("l")

i.t = m
i.o = c
n.t = c
n.z = k
m.t = k
m.o = c
a.t = n
a.z = k
c.t = a
c.z = m
k.t = i
k.o = l
l.t = n
l.z = m
assert l.t.z.t.t.txt == "m"