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

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

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

c = A("c")
k = B("k")
n = C("n")
e = A("e")
b = B("b")

c.z = k
c.u = e
c.v = n
k.v = e
k.s = b
k.o = b
n.v = e
n.y = e
n.q = b
e.z = k
e.u = c
e.v = n
b.v = e
b.s = k
b.o = k
assert k.s.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
n = C("n")
e = A("e")
b = B("b")

c.z = k
c.u = e
c.v = n
k.v = e
k.s = b
k.o = b
n.v = e
n.y = e
n.q = b
e.z = k
e.u = c
e.v = n
b.v = e
b.s = k
b.o = k
assert k.s.s.v.txt == "e"