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

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

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

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

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

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

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

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

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

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

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

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

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