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

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

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

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

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

i.w = k
i.u = e
e.x = i
a.o = e
a.v = k
a.p = k
a.z = n
k.v = c
k.p = c
k.q = a
c.x = i
n.o = c
n.v = k
n.p = k
n.z = a
assert k.q.z.o.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: B = None
        self.txt = txt

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

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

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

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

i.w = k
i.u = e
e.x = i
a.o = e
a.v = k
a.p = k
a.z = n
k.v = c
k.p = c
k.q = a
c.x = i
n.o = c
n.v = k
n.p = k
n.z = a
assert k.q.z.o.x.u.txt == "e"