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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: A = None
        self.o: B = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

m = A("m")
g = B("g")
b = C("b")
n = D("n")
h = E("h")
l = D("l")
e = E("e")
i = C("i")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: A = None
        self.o: B = None
        self.w: A = None
        self.z: D = None
        self.txt = txt

m = A("m")
g = B("g")
b = C("b")
n = D("n")
h = E("h")
l = D("l")
e = E("e")
i = C("i")

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