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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: B = None
        self.t: A = None
        self.p: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: B = None
        self.t: A = None
        self.p: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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