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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: D = None
        self.y: C = None
        self.txt = txt

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

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

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

k.z = c
k.t = m
k.v = l
d.z = c
d.y = b
d.x = k
i.t = d
i.q = m
i.y = e
a.y = m
a.q = m
a.w = l
a.t = i
c.z = a
c.v = k
c.q = k
b.t = d
b.q = m
b.y = i
e.t = d
e.q = a
e.y = i
l.z = a
l.v = k
l.q = k
m.y = a
m.q = a
m.w = l
m.t = i
g.t = d
g.q = a
g.y = i
assert m.w.v.z.v.t.w.v.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: D = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: D = None
        self.y: C = None
        self.txt = txt

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

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

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

k.z = c
k.t = m
k.v = l
d.z = c
d.y = b
d.x = k
i.t = d
i.q = m
i.y = e
a.y = m
a.q = m
a.w = l
a.t = i
c.z = a
c.v = k
c.q = k
b.t = d
b.q = m
b.y = i
e.t = d
e.q = a
e.y = i
l.z = a
l.v = k
l.q = k
m.y = a
m.q = a
m.w = l
m.t = i
g.t = d
g.q = a
g.y = i
assert m.w.v.z.v.t.w.v.t.w.txt == "l"