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

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

c = A("c")
b = B("b")
j = A("j")
a = B("a")
k = B("k")
l = A("l")

c.t = a
c.o = j
b.x = j
b.u = l
j.t = a
j.o = l
a.x = c
a.u = j
k.x = l
k.u = j
l.t = a
l.o = j
assert b.x.t.u.t.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: A = None
        self.txt = txt

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

c = A("c")
b = B("b")
j = A("j")
a = B("a")
k = B("k")
l = A("l")

c.t = a
c.o = j
b.x = j
b.u = l
j.t = a
j.o = l
a.x = c
a.u = j
k.x = l
k.u = j
l.t = a
l.o = j
assert b.x.t.u.t.u.o.txt == "l"