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

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

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

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

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

e.r = l
e.v = f
e.u = d
n.z = d
k.u = j
l.w = f
l.u = d
l.z = g
f.w = l
f.u = d
f.z = e
j.u = k
d.z = n
g.r = f
g.v = f
g.u = n
assert e.v.w.z.r.w.w.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: D = None
        self.u: B = None
        self.txt = txt

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

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

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

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

e.r = l
e.v = f
e.u = d
n.z = d
k.u = j
l.w = f
l.u = d
l.z = g
f.w = l
f.u = d
f.z = e
j.u = k
d.z = n
g.r = f
g.v = f
g.u = n
assert e.v.w.z.r.w.w.u.z.txt == "n"