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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.s: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

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

i = A("i")
m = B("m")
a = C("a")
k = D("k")
n = E("n")
f = D("f")

i.z = k
i.q = a
i.w = n
m.s = a
m.u = k
m.q = n
m.w = n
a.q = m
a.r = m
a.o = n
k.x = m
k.y = n
k.s = n
k.q = n
k.u = n
n.t = k
n.v = m
f.x = m
f.y = n
f.s = n
f.q = n
f.u = n
assert f.s.t.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: C = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.s: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

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

i = A("i")
m = B("m")
a = C("a")
k = D("k")
n = E("n")
f = D("f")

i.z = k
i.q = a
i.w = n
m.s = a
m.u = k
m.q = n
m.w = n
a.q = m
a.r = m
a.o = n
k.x = m
k.y = n
k.s = n
k.q = n
k.u = n
n.t = k
n.v = m
f.x = m
f.y = n
f.s = n
f.q = n
f.u = n
assert f.s.t.x.w.txt == "n"