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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

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

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

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