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

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

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

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

i = A("i")
e = B("e")
c = C("c")
l = D("l")
m = C("m")
a = B("a")
f = A("f")
n = C("n")
k = D("k")
b = D("b")

i.q = f
i.u = f
i.o = a
e.t = m
e.z = b
c.u = e
c.x = b
l.x = a
l.z = k
l.s = e
m.u = e
m.x = b
a.t = n
a.z = b
f.q = i
f.u = i
f.o = e
n.u = a
n.x = l
k.x = e
k.z = l
k.s = a
b.x = a
b.s = a
b.z = l
assert n.u.z.x.z.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

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

i = A("i")
e = B("e")
c = C("c")
l = D("l")
m = C("m")
a = B("a")
f = A("f")
n = C("n")
k = D("k")
b = D("b")

i.q = f
i.u = f
i.o = a
e.t = m
e.z = b
c.u = e
c.x = b
l.x = a
l.z = k
l.s = e
m.u = e
m.x = b
a.t = n
a.z = b
f.q = i
f.u = i
f.o = e
n.u = a
n.x = l
k.x = e
k.z = l
k.s = a
b.x = a
b.s = a
b.z = l
assert n.u.z.x.z.s.t.txt == "n"