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

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

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: B = None
        self.r: C = None
        self.o: A = None
        self.txt = txt

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

k.w = j
e.o = h
e.x = i
e.u = n
n.v = i
b.s = l
b.w = e
b.r = n
b.o = k
j.o = e
j.x = a
j.u = n
i.w = h
l.s = b
l.w = j
l.r = n
l.o = i
h.o = e
h.x = k
h.u = n
m.s = b
m.w = j
m.r = n
m.o = a
a.w = h
assert a.w.u.v.w.o.u.v.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: B = None
        self.r: C = None
        self.o: A = None
        self.txt = txt

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

k.w = j
e.o = h
e.x = i
e.u = n
n.v = i
b.s = l
b.w = e
b.r = n
b.o = k
j.o = e
j.x = a
j.u = n
i.w = h
l.s = b
l.w = j
l.r = n
l.o = i
h.o = e
h.x = k
h.u = n
m.s = b
m.w = j
m.r = n
m.o = a
a.w = h
assert a.w.u.v.w.o.u.v.w.u.txt == "n"