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

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

e = A("e")
b = B("b")
c = B("c")
l = B("l")
j = B("j")
a = B("a")
f = B("f")

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

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

e = A("e")
b = B("b")
c = B("c")
l = B("l")
j = B("j")
a = B("a")
f = B("f")

e.t = b
b.x = e
c.x = e
l.x = e
j.x = e
a.x = e
f.x = e
assert c.x.t.x.t.x.txt == "e"