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

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

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

c = A("c")
i = B("i")
d = C("d")
k = B("k")

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

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

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

c = A("c")
i = B("i")
d = C("d")
k = B("k")

c.u = d
i.o = d
i.t = d
i.y = c
d.v = k
d.x = i
k.o = d
k.t = d
k.y = c
assert c.u.v.o.x.txt == "i"