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

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

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

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

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

m = A("m")
c = B("c")
h = C("h")
n = D("n")
d = E("d")
l = C("l")
k = D("k")
j = B("j")
i = E("i")

m.z = i
m.u = i
m.t = n
m.r = n
m.p = n
c.r = i
c.w = l
h.s = d
n.p = h
d.t = h
d.u = i
d.z = j
d.v = l
l.s = d
k.p = h
j.r = i
j.w = h
i.t = l
i.u = d
i.z = j
i.v = h
assert d.t.s.v.s.u.z.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: E = None
        self.t: D = None
        self.r: D = None
        self.p: D = None
        self.txt = txt

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

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

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

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

m = A("m")
c = B("c")
h = C("h")
n = D("n")
d = E("d")
l = C("l")
k = D("k")
j = B("j")
i = E("i")

m.z = i
m.u = i
m.t = n
m.r = n
m.p = n
c.r = i
c.w = l
h.s = d
n.p = h
d.t = h
d.u = i
d.z = j
d.v = l
l.s = d
k.p = h
j.r = i
j.w = h
i.t = l
i.u = d
i.z = j
i.v = h
assert d.t.s.v.s.u.z.w.s.txt == "d"