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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: E = None
        self.o: C = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

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

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

e = A("e")
h = B("h")
k = C("k")
i = D("i")
l = E("l")
n = A("n")
m = C("m")
d = D("d")
c = D("c")
g = E("g")

e.q = h
e.u = h
e.v = g
e.t = l
h.q = e
h.r = g
h.z = k
k.w = n
k.r = n
k.u = l
k.o = m
k.v = d
i.w = d
i.o = n
i.v = h
l.p = i
l.s = e
l.z = k
l.o = n
l.w = h
n.q = h
n.u = h
n.v = l
n.t = g
m.w = n
m.r = n
m.u = g
m.o = k
m.v = d
d.w = i
d.o = n
d.v = h
c.w = i
c.o = n
c.v = h
g.p = i
g.s = n
g.o = n
g.z = m
g.w = h
assert m.u.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: E = None
        self.u: B = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: E = None
        self.o: C = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

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

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

e = A("e")
h = B("h")
k = C("k")
i = D("i")
l = E("l")
n = A("n")
m = C("m")
d = D("d")
c = D("c")
g = E("g")

e.q = h
e.u = h
e.v = g
e.t = l
h.q = e
h.r = g
h.z = k
k.w = n
k.r = n
k.u = l
k.o = m
k.v = d
i.w = d
i.o = n
i.v = h
l.p = i
l.s = e
l.z = k
l.o = n
l.w = h
n.q = h
n.u = h
n.v = l
n.t = g
m.w = n
m.r = n
m.u = g
m.o = k
m.v = d
d.w = i
d.o = n
d.v = h
c.w = i
c.o = n
c.v = h
g.p = i
g.s = n
g.o = n
g.z = m
g.w = h
assert m.u.p.v.txt == "h"