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

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

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

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

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

h.p = b
h.r = e
h.z = j
h.o = n
k.v = l
k.s = h
j.u = i
j.w = k
j.v = l
e.v = b
e.o = b
e.t = j
e.q = l
i.v = j
i.s = h
l.u = k
l.w = k
l.v = j
b.v = e
b.o = e
b.t = l
b.q = l
f.p = e
f.r = b
f.z = l
f.o = h
n.p = e
n.r = b
n.z = l
n.o = f
assert j.v.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: D = None
        self.z: C = None
        self.o: A = None
        self.txt = txt

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

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

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

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

h.p = b
h.r = e
h.z = j
h.o = n
k.v = l
k.s = h
j.u = i
j.w = k
j.v = l
e.v = b
e.o = b
e.t = j
e.q = l
i.v = j
i.s = h
l.u = k
l.w = k
l.v = j
b.v = e
b.o = e
b.t = l
b.q = l
f.p = e
f.r = b
f.z = l
f.o = h
n.p = e
n.r = b
n.z = l
n.o = f
assert j.v.w.s.txt == "h"