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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

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

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

k.p = j
k.x = n
k.o = d
e.r = d
e.u = j
e.z = f
e.v = l
i.x = k
i.p = l
j.r = d
j.o = k
j.t = a
j.z = f
f.x = k
f.p = i
d.r = a
d.o = k
d.t = j
d.z = l
a.r = d
a.o = k
a.t = j
a.z = i
c.x = k
c.p = l
l.x = k
l.p = i
n.r = j
n.u = d
n.z = i
n.v = c
assert j.z.x.x.u.r.r.z.x.x.txt == "n"