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

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.s: B = None
        self.y: E = None
        self.t: B = None
        self.txt = txt

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

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

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

i.q = g
k.p = h
k.z = l
k.r = i
k.s = n
h.p = g
h.v = i
h.s = k
h.t = k
h.y = e
l.u = e
e.o = a
e.p = a
n.q = h
g.p = h
g.v = i
g.s = k
g.t = k
g.y = e
a.u = e
assert h.t.r.q.v.q.p.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.s: B = None
        self.y: E = None
        self.t: B = None
        self.txt = txt

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

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

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

i.q = g
k.p = h
k.z = l
k.r = i
k.s = n
h.p = g
h.v = i
h.s = k
h.t = k
h.y = e
l.u = e
e.o = a
e.p = a
n.q = h
g.p = h
g.v = i
g.s = k
g.t = k
g.y = e
a.u = e
assert h.t.r.q.v.q.p.y.p.txt == "a"