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

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

l = A("l")
h = B("h")
i = B("i")
f = B("f")
j = B("j")
g = B("g")

l.v = i
h.t = l
i.t = l
f.t = l
j.t = l
g.t = l
assert f.t.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

l = A("l")
h = B("h")
i = B("i")
f = B("f")
j = B("j")
g = B("g")

l.v = i
h.t = l
i.t = l
f.t = l
j.t = l
g.t = l
assert f.t.v.t.txt == "l"