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

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

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

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

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

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

g.u = m
g.w = k
l.p = k
d.t = e
d.y = e
d.v = e
d.z = l
d.o = l
n.p = k
n.v = k
n.t = l
n.o = d
n.z = d
m.u = n
m.t = g
m.w = i
m.q = d
k.p = n
k.v = n
k.t = l
k.o = e
k.z = d
e.t = d
e.y = d
e.v = d
e.z = l
e.o = l
i.u = k
i.t = g
i.w = m
i.q = e
assert m.t.w.t.p.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

g.u = m
g.w = k
l.p = k
d.t = e
d.y = e
d.v = e
d.z = l
d.o = l
n.p = k
n.v = k
n.t = l
n.o = d
n.z = d
m.u = n
m.t = g
m.w = i
m.q = d
k.p = n
k.v = n
k.t = l
k.o = e
k.z = d
e.t = d
e.y = d
e.v = d
e.z = l
e.o = l
i.u = k
i.t = g
i.w = m
i.q = e
assert m.t.w.t.p.v.z.txt == "d"