class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

j.s = f
j.q = f
j.p = m
f.w = m
i.p = a
i.r = m
i.x = d
i.z = d
a.z = n
d.u = f
d.v = i
d.p = m
m.u = f
m.v = i
m.p = d
l.z = j
n.s = f
n.q = f
n.p = m
assert j.p.v.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

j.s = f
j.q = f
j.p = m
f.w = m
i.p = a
i.r = m
i.x = d
i.z = d
a.z = n
d.u = f
d.v = i
d.p = m
m.u = f
m.v = i
m.p = d
l.z = j
n.s = f
n.q = f
n.p = m
assert j.p.v.p.z.txt == "n"