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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

n.z = k
n.o = a
n.y = d
n.r = i
f.u = n
f.z = n
i.s = f
g.v = k
l.s = m
l.y = m
l.u = e
k.u = n
k.z = a
m.s = l
m.y = l
m.u = e
d.s = k
a.z = f
a.o = n
a.y = d
a.r = i
e.v = f
assert i.s.z.r.s.z.r.s.z.z.txt == "k"