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

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

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

c = A("c")
b = B("b")
m = C("m")
f = C("f")
a = B("a")
i = A("i")
j = B("j")
g = A("g")
l = C("l")
n = C("n")

c.u = b
c.v = b
c.z = g
b.r = l
b.x = g
b.o = n
m.s = b
m.w = g
f.s = j
f.w = c
a.r = l
a.x = i
a.o = f
i.u = a
i.z = c
i.v = j
j.r = l
j.o = l
j.x = g
g.u = a
g.z = i
g.v = b
l.s = b
l.w = g
n.s = j
n.w = g
assert a.r.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: A = None
        self.v: B = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
m = C("m")
f = C("f")
a = B("a")
i = A("i")
j = B("j")
g = A("g")
l = C("l")
n = C("n")

c.u = b
c.v = b
c.z = g
b.r = l
b.x = g
b.o = n
m.s = b
m.w = g
f.s = j
f.w = c
a.r = l
a.x = i
a.o = f
i.u = a
i.z = c
i.v = j
j.r = l
j.o = l
j.x = g
g.u = a
g.z = i
g.v = b
l.s = b
l.w = g
n.s = j
n.w = g
assert a.r.s.r.txt == "l"