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

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

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

l = A("l")
j = B("j")
n = C("n")
b = B("b")
m = C("m")
d = A("d")
k = B("k")

l.t = d
l.z = k
l.r = k
j.v = l
j.o = m
j.u = b
n.o = k
n.z = m
b.v = l
b.o = m
b.u = j
m.o = k
m.z = n
d.t = l
d.z = k
d.r = b
k.v = d
k.o = n
k.u = j
assert b.u.v.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

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

l = A("l")
j = B("j")
n = C("n")
b = B("b")
m = C("m")
d = A("d")
k = B("k")

l.t = d
l.z = k
l.r = k
j.v = l
j.o = m
j.u = b
n.o = k
n.z = m
b.v = l
b.o = m
b.u = j
m.o = k
m.z = n
d.t = l
d.z = k
d.r = b
k.v = d
k.o = n
k.u = j
assert b.u.v.z.o.txt == "n"