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

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

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

b = A("b")
d = B("d")
i = C("i")
l = C("l")
c = C("c")

b.x = i
b.v = c
d.x = b
d.u = c
i.o = d
i.t = b
i.v = c
l.o = d
l.t = b
l.v = c
c.o = d
c.t = b
c.v = i
assert b.v.v.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

b = A("b")
d = B("d")
i = C("i")
l = C("l")
c = C("c")

b.x = i
b.v = c
d.x = b
d.u = c
i.o = d
i.t = b
i.v = c
l.o = d
l.t = b
l.v = c
c.o = d
c.t = b
c.v = i
assert b.v.v.o.x.txt == "b"