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

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

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

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

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

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

g.z = e
g.v = a
g.r = h
m.t = e
m.z = g
m.u = g
m.x = l
m.o = c
d.s = k
d.x = h
h.u = l
j.s = g
c.s = a
k.s = d
k.x = h
l.t = e
l.z = a
l.u = a
l.x = m
l.o = j
e.s = d
e.x = h
a.z = d
a.v = g
a.r = h
assert m.x.z.z.s.x.u.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: A = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

g.z = e
g.v = a
g.r = h
m.t = e
m.z = g
m.u = g
m.x = l
m.o = c
d.s = k
d.x = h
h.u = l
j.s = g
c.s = a
k.s = d
k.x = h
l.t = e
l.z = a
l.u = a
l.x = m
l.o = j
e.s = d
e.x = h
a.z = d
a.v = g
a.r = h
assert m.x.z.z.s.x.u.u.r.txt == "h"