class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

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