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

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.r: C = None
        self.v: C = None
        self.s: B = None
        self.txt = txt

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

m = A("m")
d = B("d")
b = C("b")
i = D("i")
c = E("c")
g = E("g")
h = D("h")
a = D("a")
n = A("n")

m.t = c
d.y = b
d.w = b
d.x = a
d.t = c
d.o = c
b.v = d
b.u = i
i.q = h
i.w = b
i.r = b
i.v = b
i.s = d
c.v = b
c.z = d
g.v = b
g.z = d
h.q = a
h.w = b
h.r = b
h.v = b
h.s = d
a.q = i
a.w = b
a.r = b
a.v = b
a.s = d
n.t = g
assert d.x.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.r: C = None
        self.v: C = None
        self.s: B = None
        self.txt = txt

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

m = A("m")
d = B("d")
b = C("b")
i = D("i")
c = E("c")
g = E("g")
h = D("h")
a = D("a")
n = A("n")

m.t = c
d.y = b
d.w = b
d.x = a
d.t = c
d.o = c
b.v = d
b.u = i
i.q = h
i.w = b
i.r = b
i.v = b
i.s = d
c.v = b
c.z = d
g.v = b
g.z = d
h.q = a
h.w = b
h.r = b
h.v = b
h.s = d
a.q = i
a.w = b
a.r = b
a.v = b
a.s = d
n.t = g
assert d.x.w.v.txt == "d"