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

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

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

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

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

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

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

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

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

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

k.o = h
e.o = k
e.x = h
e.u = c
h.o = i
h.t = j
h.q = j
h.w = l
a.p = h
a.x = k
a.v = n
m.p = h
m.x = k
m.v = c
j.o = k
j.x = h
j.u = e
l.p = h
l.x = k
l.v = j
i.p = h
i.x = k
i.v = j
n.o = k
n.x = h
n.u = e
c.o = k
c.x = h
c.u = e
assert n.o.o.t.u.x.q.o.o.txt == "h"