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

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

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

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

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

n.p = j
i.s = c
i.z = a
b.v = i
h.o = l
f.v = j
d.p = i
j.s = h
j.z = a
c.o = l
l.v = i
a.v = j
assert j.z.v.z.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

n.p = j
i.s = c
i.z = a
b.v = i
h.o = l
f.v = j
d.p = i
j.s = h
j.z = a
c.o = l
l.v = i
a.v = j
assert j.z.v.z.v.s.txt == "h"