class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

k.w = i
k.t = n
k.o = a
l.v = d
l.s = n
l.z = a
b.t = d
b.z = k
e.u = c
e.p = l
c.t = d
c.u = d
g.u = c
g.p = d
i.t = l
i.z = k
n.w = b
n.t = k
n.o = e
a.u = c
a.p = d
d.v = l
d.s = n
d.z = g
assert l.z.p.z.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

k.w = i
k.t = n
k.o = a
l.v = d
l.s = n
l.z = a
b.t = d
b.z = k
e.u = c
e.p = l
c.t = d
c.u = d
g.u = c
g.p = d
i.t = l
i.z = k
n.w = b
n.t = k
n.o = e
a.u = c
a.p = d
d.v = l
d.s = n
d.z = g
assert l.z.p.z.p.v.txt == "l"