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

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

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

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

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

j.v = l
j.p = k
j.x = k
d.p = n
d.u = n
d.v = a
f.y = c
f.s = e
n.z = a
e.z = c
l.y = c
l.s = e
g.v = l
g.p = k
g.x = k
c.p = n
c.v = d
c.u = e
k.y = c
k.s = e
a.p = n
a.u = n
a.v = c
assert n.z.p.z.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

j.v = l
j.p = k
j.x = k
d.p = n
d.u = n
d.v = a
f.y = c
f.s = e
n.z = a
e.z = c
l.y = c
l.s = e
g.v = l
g.p = k
g.x = k
c.p = n
c.v = d
c.u = e
k.y = c
k.s = e
a.p = n
a.u = n
a.v = c
assert n.z.p.z.v.u.txt == "e"