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

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

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

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

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

n = A("n")
l = B("l")
e = C("e")
m = D("m")
k = E("k")
i = A("i")
b = C("b")
j = D("j")
g = C("g")

n.t = i
n.z = i
n.r = i
l.t = k
l.r = n
e.t = k
e.w = k
e.p = n
e.s = l
e.v = l
m.t = k
k.p = j
k.o = l
i.t = n
i.z = n
i.r = n
b.t = k
b.w = k
b.p = n
b.s = l
b.v = l
j.t = k
g.t = k
g.w = k
g.p = i
g.s = l
g.v = l
assert j.t.p.t.o.t.p.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

n = A("n")
l = B("l")
e = C("e")
m = D("m")
k = E("k")
i = A("i")
b = C("b")
j = D("j")
g = C("g")

n.t = i
n.z = i
n.r = i
l.t = k
l.r = n
e.t = k
e.w = k
e.p = n
e.s = l
e.v = l
m.t = k
k.p = j
k.o = l
i.t = n
i.z = n
i.r = n
b.t = k
b.w = k
b.p = n
b.s = l
b.v = l
j.t = k
g.t = k
g.w = k
g.p = i
g.s = l
g.v = l
assert j.t.p.t.o.t.p.t.o.txt == "l"