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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

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

n.q = a
n.w = e
n.u = k
e.t = a
e.u = a
a.u = k
a.r = k
a.s = n
a.o = e
k.x = a
k.r = e
i.q = a
i.w = e
i.u = k
assert i.q.o.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

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

n.q = a
n.w = e
n.u = k
e.t = a
e.u = a
a.u = k
a.r = k
a.s = n
a.o = e
k.x = a
k.r = e
i.q = a
i.w = e
i.u = k
assert i.q.o.u.o.u.txt == "a"