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

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: E = None
        self.s: A = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

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

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

n = A("n")
a = B("a")
g = C("g")
e = D("e")
i = E("i")
l = B("l")
h = A("h")
m = C("m")
j = C("j")

n.v = a
a.u = l
a.r = i
a.s = n
a.t = m
a.x = j
g.v = m
g.u = h
g.s = n
e.r = i
i.w = h
l.u = a
l.r = i
l.s = n
l.t = g
l.x = j
h.v = l
m.v = g
m.u = n
m.s = n
j.v = m
j.u = n
j.s = h
assert h.v.s.v.s.v.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: E = None
        self.s: A = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

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

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

n = A("n")
a = B("a")
g = C("g")
e = D("e")
i = E("i")
l = B("l")
h = A("h")
m = C("m")
j = C("j")

n.v = a
a.u = l
a.r = i
a.s = n
a.t = m
a.x = j
g.v = m
g.u = h
g.s = n
e.r = i
i.w = h
l.u = a
l.r = i
l.s = n
l.t = g
l.x = j
h.v = l
m.v = g
m.u = n
m.s = n
j.v = m
j.u = n
j.s = h
assert h.v.s.v.s.v.u.u.txt == "a"