class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

a.u = i
a.p = c
a.q = b
a.x = k
b.r = l
b.x = j
b.z = d
b.v = d
d.t = b
d.z = b
d.s = i
d.x = i
d.v = j
k.w = a
k.u = a
k.y = i
k.p = i
n.w = b
n.s = l
c.t = l
c.z = l
c.s = i
c.x = i
c.v = j
i.w = a
i.u = a
i.y = k
i.p = k
j.w = b
j.s = l
l.r = b
l.x = m
l.z = c
l.v = d
m.w = l
m.s = l
assert k.p.y.y.p.u.q.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

a.u = i
a.p = c
a.q = b
a.x = k
b.r = l
b.x = j
b.z = d
b.v = d
d.t = b
d.z = b
d.s = i
d.x = i
d.v = j
k.w = a
k.u = a
k.y = i
k.p = i
n.w = b
n.s = l
c.t = l
c.z = l
c.s = i
c.x = i
c.v = j
i.w = a
i.u = a
i.y = k
i.p = k
j.w = b
j.s = l
l.r = b
l.x = m
l.z = c
l.v = d
m.w = l
m.s = l
assert k.p.y.y.p.u.q.r.v.txt == "d"