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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.p: E = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.p: E = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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