class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.t: B = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: E = None
        self.t: E = None
        self.w: A = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
e = B("e")
i = C("i")
h = D("h")
c = E("c")
a = E("a")
f = C("f")

n.q = a
n.o = a
n.t = e
n.w = h
n.p = h
e.u = n
e.q = h
i.p = e
i.v = e
h.s = i
h.o = a
h.t = c
h.w = n
h.y = f
c.s = i
c.q = a
c.v = e
a.s = f
a.q = c
a.v = e
f.p = e
f.v = e
assert e.q.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.t: B = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: E = None
        self.t: E = None
        self.w: A = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
e = B("e")
i = C("i")
h = D("h")
c = E("c")
a = E("a")
f = C("f")

n.q = a
n.o = a
n.t = e
n.w = h
n.p = h
e.u = n
e.q = h
i.p = e
i.v = e
h.s = i
h.o = a
h.t = c
h.w = n
h.y = f
c.s = i
c.q = a
c.v = e
a.s = f
a.q = c
a.v = e
f.p = e
f.v = e
assert e.q.o.v.txt == "e"