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

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

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

b = A("b")
l = B("l")
e = C("e")
k = A("k")
f = A("f")
m = B("m")
j = B("j")
g = C("g")
a = C("a")
c = C("c")

b.u = e
b.p = g
l.y = c
l.u = j
l.z = a
e.v = f
e.r = f
k.u = e
k.p = e
f.u = e
f.p = g
m.y = e
m.z = e
m.u = l
j.y = c
j.u = l
j.z = a
g.v = b
g.r = k
a.v = k
a.r = f
c.v = b
c.r = f
assert a.v.u.v.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
e = C("e")
k = A("k")
f = A("f")
m = B("m")
j = B("j")
g = C("g")
a = C("a")
c = C("c")

b.u = e
b.p = g
l.y = c
l.u = j
l.z = a
e.v = f
e.r = f
k.u = e
k.p = e
f.u = e
f.p = g
m.y = e
m.z = e
m.u = l
j.y = c
j.u = l
j.z = a
g.v = b
g.r = k
a.v = k
a.r = f
c.v = b
c.r = f
assert a.v.u.v.u.v.u.txt == "e"