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

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

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

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

h = A("h")
n = B("n")
e = C("e")
l = D("l")
i = B("i")
m = B("m")
k = C("k")
g = C("g")

h.v = l
h.u = e
h.y = e
n.y = i
n.o = e
e.p = h
l.p = h
l.z = g
l.o = g
i.y = m
i.o = e
m.y = n
m.o = k
k.p = h
g.p = h
assert k.p.v.p.u.p.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: C = None
        self.y: C = None
        self.txt = txt

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

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

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

h = A("h")
n = B("n")
e = C("e")
l = D("l")
i = B("i")
m = B("m")
k = C("k")
g = C("g")

h.v = l
h.u = e
h.y = e
n.y = i
n.o = e
e.p = h
l.p = h
l.z = g
l.o = g
i.y = m
i.o = e
m.y = n
m.o = k
k.p = h
g.p = h
assert k.p.v.p.u.p.v.p.v.txt == "l"