class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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