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

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

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

n = A("n")
i = B("i")
e = C("e")
b = C("b")
j = C("j")
l = C("l")

n.v = i
n.z = l
i.u = n
e.u = i
e.z = l
b.u = i
b.z = e
j.u = i
j.z = e
l.u = i
l.z = j
assert j.z.u.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: C = None
        self.txt = txt

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

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

n = A("n")
i = B("i")
e = C("e")
b = C("b")
j = C("j")
l = C("l")

n.v = i
n.z = l
i.u = n
e.u = i
e.z = l
b.u = i
b.z = e
j.u = i
j.z = e
l.u = i
l.z = j
assert j.z.u.u.v.u.txt == "n"