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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

e = A("e")
c = B("c")
b = C("b")
m = D("m")
a = B("a")
h = D("h")
j = D("j")
n = A("n")
l = B("l")

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

e = A("e")
c = B("c")
b = C("b")
m = D("m")
a = B("a")
h = D("h")
j = D("j")
n = A("n")
l = B("l")

e.u = m
e.w = l
e.v = b
e.p = b
c.s = e
c.v = e
c.z = e
b.t = e
b.u = n
b.r = j
b.w = j
m.p = c
m.z = b
m.r = a
a.s = n
a.v = e
a.z = e
h.p = a
h.z = b
h.r = l
j.p = a
j.z = b
j.r = l
n.u = m
n.w = c
n.v = b
n.p = b
l.s = e
l.v = n
l.z = n
assert e.u.z.u.v.r.z.r.txt == "j"