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

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

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: A = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

n.x = f
n.o = d
n.q = k
k.w = d
k.v = d
f.q = k
f.u = e
f.y = n
f.p = l
l.v = a
l.y = i
l.z = m
l.x = m
i.x = d
i.o = f
i.q = k
h.x = d
h.o = f
h.q = k
e.v = a
e.z = a
e.x = a
e.y = i
m.v = a
m.y = i
m.z = e
m.x = e
d.q = k
d.u = m
d.y = h
d.p = l
a.v = l
a.y = h
a.z = e
a.x = e
assert m.y.o.q.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: A = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

n.x = f
n.o = d
n.q = k
k.w = d
k.v = d
f.q = k
f.u = e
f.y = n
f.p = l
l.v = a
l.y = i
l.z = m
l.x = m
i.x = d
i.o = f
i.q = k
h.x = d
h.o = f
h.q = k
e.v = a
e.z = a
e.x = a
e.y = i
m.v = a
m.y = i
m.z = e
m.x = e
d.q = k
d.u = m
d.y = h
d.p = l
a.v = l
a.y = h
a.z = e
a.x = e
assert m.y.o.q.v.q.txt == "k"