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

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

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

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

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

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

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

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

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