class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: C = None
        self.t: A = None
        self.u: A = None
        self.s: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.r: E = None
        self.o: C = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.r: E = None
        self.o: C = None
        self.t: B = None
        self.txt = txt

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

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

k.o = h
k.r = j
k.t = i
k.u = i
k.s = m
d.z = h
j.p = a
j.s = k
h.q = d
h.t = d
h.x = n
h.r = m
h.o = j
m.o = k
m.v = i
i.o = h
i.r = n
i.t = k
i.u = k
i.s = a
n.p = m
n.s = k
e.z = h
a.o = k
a.v = i
g.z = h
assert m.v.u.t.r.s.r.txt == "j"