class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: C = None
        self.o: A = None
        self.y: A = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.o: B = None
        self.y: E = None
        self.p: B = None
        self.txt = txt

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

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

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

h.u = e
h.x = e
h.t = n
h.o = m
h.y = m
l.p = h
n.t = e
n.y = e
n.u = j
n.o = l
n.p = l
j.u = m
j.v = h
j.p = e
e.q = j
e.x = j
e.p = n
m.u = e
m.x = e
m.t = n
m.o = h
m.y = h
assert n.y.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: C = None
        self.o: A = None
        self.y: A = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.o: B = None
        self.y: E = None
        self.p: B = None
        self.txt = txt

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

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

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

h.u = e
h.x = e
h.t = n
h.o = m
h.y = m
l.p = h
n.t = e
n.y = e
n.u = j
n.o = l
n.p = l
j.u = m
j.v = h
j.p = e
e.q = j
e.x = j
e.p = n
m.u = e
m.x = e
m.t = n
m.o = h
m.y = h
assert n.y.q.v.txt == "h"