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

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

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

a = A("a")
h = B("h")
m = C("m")
d = B("d")
c = A("c")
l = B("l")
j = B("j")
n = B("n")
b = C("b")
e = A("e")

a.p = n
a.v = m
a.y = m
h.z = l
h.o = l
h.u = b
m.z = a
m.p = h
m.y = b
d.z = n
d.o = j
d.u = b
c.p = h
c.v = b
c.y = m
l.z = h
l.o = j
l.u = b
j.z = n
j.o = l
j.u = m
n.z = d
n.o = d
n.u = m
b.z = a
b.p = l
b.y = m
e.p = h
e.v = m
e.y = m
assert n.u.p.o.o.u.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

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

a = A("a")
h = B("h")
m = C("m")
d = B("d")
c = A("c")
l = B("l")
j = B("j")
n = B("n")
b = C("b")
e = A("e")

a.p = n
a.v = m
a.y = m
h.z = l
h.o = l
h.u = b
m.z = a
m.p = h
m.y = b
d.z = n
d.o = j
d.u = b
c.p = h
c.v = b
c.y = m
l.z = h
l.o = j
l.u = b
j.z = n
j.o = l
j.u = m
n.z = d
n.o = d
n.u = m
b.z = a
b.p = l
b.y = m
e.p = h
e.v = m
e.y = m
assert n.u.p.o.o.u.z.y.txt == "m"