class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: A = None
        self.q: B = None
        self.s: B = None
        self.y: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

a.s = d
a.q = n
a.v = j
i.u = a
i.z = d
j.s = i
j.y = i
j.o = n
m.w = a
m.v = a
m.q = i
m.s = i
m.y = n
d.x = m
d.t = a
d.w = a
h.s = i
h.y = i
h.o = m
n.w = a
n.v = a
n.q = i
n.s = i
n.y = m
assert n.y.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: A = None
        self.q: B = None
        self.s: B = None
        self.y: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

a.s = d
a.q = n
a.v = j
i.u = a
i.z = d
j.s = i
j.y = i
j.o = n
m.w = a
m.v = a
m.q = i
m.s = i
m.y = n
d.x = m
d.t = a
d.w = a
h.s = i
h.y = i
h.o = m
n.w = a
n.v = a
n.q = i
n.s = i
n.y = m
assert n.y.v.v.txt == "j"