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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

k = A("k")
c = B("c")
n = C("n")
e = D("e")
d = E("d")
a = C("a")
i = A("i")
m = B("m")
l = B("l")

k.p = n
k.y = d
c.z = e
c.o = d
c.u = n
n.v = a
n.q = a
n.r = c
e.w = d
d.w = c
a.v = n
a.q = n
a.r = c
i.p = a
i.y = d
m.z = e
m.o = d
m.u = n
l.z = e
l.o = d
l.u = a
assert c.o.w.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

k = A("k")
c = B("c")
n = C("n")
e = D("e")
d = E("d")
a = C("a")
i = A("i")
m = B("m")
l = B("l")

k.p = n
k.y = d
c.z = e
c.o = d
c.u = n
n.v = a
n.q = a
n.r = c
e.w = d
d.w = c
a.v = n
a.q = n
a.r = c
i.p = a
i.y = d
m.z = e
m.o = d
m.u = n
l.z = e
l.o = d
l.u = a
assert c.o.w.u.v.txt == "a"