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

class B:
    def __init__(self, txt: str):
        self.v: 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.v: B = None
        self.t: C = None
        self.w: D = None
        self.txt = txt

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

l.r = e
l.z = e
l.p = m
l.y = i
a.v = e
e.p = j
n.v = m
n.t = e
n.w = i
h.v = e
d.v = h
d.t = e
d.w = n
m.v = e
i.v = a
i.t = e
i.w = f
f.v = a
f.t = e
f.w = n
j.r = e
j.z = e
j.p = m
j.y = d
assert n.w.v.v.p.y.w.w.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: 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.v: B = None
        self.t: C = None
        self.w: D = None
        self.txt = txt

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

l.r = e
l.z = e
l.p = m
l.y = i
a.v = e
e.p = j
n.v = m
n.t = e
n.w = i
h.v = e
d.v = h
d.t = e
d.w = n
m.v = e
i.v = a
i.t = e
i.w = f
f.v = a
f.t = e
f.w = n
j.r = e
j.z = e
j.p = m
j.y = d
assert n.w.v.v.p.y.w.w.t.p.txt == "j"