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

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

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

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

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

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

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

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

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

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

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

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

i.u = f
i.q = m
n.w = m
k.z = m
k.u = f
k.p = e
k.x = a
a.o = n
a.p = m
a.u = m
a.x = j
l.q = m
l.r = j
e.z = m
e.x = m
e.u = i
e.p = k
j.q = m
j.r = c
m.o = n
m.p = a
m.u = a
m.x = j
f.u = i
f.q = a
c.q = m
c.r = j
assert f.q.o.w.x.q.u.p.o.txt == "n"