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

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

j = A("j")
k = B("k")
a = B("a")
l = B("l")
g = A("g")
e = B("e")

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

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

j = A("j")
k = B("k")
a = B("a")
l = B("l")
g = A("g")
e = B("e")

j.o = k
j.y = l
k.u = e
k.t = l
a.u = k
a.t = e
l.u = e
l.t = a
g.o = e
g.y = k
e.u = l
e.t = k
assert l.u.t.u.u.t.txt == "a"