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

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

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

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

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

n = A("n")
m = B("m")
a = C("a")
k = D("k")
j = E("j")
c = C("c")
f = D("f")

n.v = m
n.z = f
m.z = c
m.o = j
m.q = j
m.y = k
a.w = c
a.u = m
a.p = n
k.o = m
k.p = m
k.z = j
k.r = f
k.u = c
j.o = m
c.w = a
c.u = m
c.p = n
f.o = m
f.p = m
f.z = j
f.r = k
f.u = a
assert n.v.y.z.o.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

n = A("n")
m = B("m")
a = C("a")
k = D("k")
j = E("j")
c = C("c")
f = D("f")

n.v = m
n.z = f
m.z = c
m.o = j
m.q = j
m.y = k
a.w = c
a.u = m
a.p = n
k.o = m
k.p = m
k.z = j
k.r = f
k.u = c
j.o = m
c.w = a
c.u = m
c.p = n
f.o = m
f.p = m
f.z = j
f.r = k
f.u = a
assert n.v.y.z.o.z.p.txt == "n"