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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

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

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

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

k.v = i
k.p = i
k.z = a
k.s = d
k.u = l
h.v = k
h.s = a
l.s = a
l.z = b
l.q = b
b.z = m
b.o = m
b.x = d
m.o = i
a.s = l
a.z = b
a.q = g
g.z = m
g.o = n
g.x = d
n.o = d
i.v = k
i.s = a
d.v = k
d.s = l
assert g.x.v.s.s.s.z.z.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: C = None
        self.s: B = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

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

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

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

k.v = i
k.p = i
k.z = a
k.s = d
k.u = l
h.v = k
h.s = a
l.s = a
l.z = b
l.q = b
b.z = m
b.o = m
b.x = d
m.o = i
a.s = l
a.z = b
a.q = g
g.z = m
g.o = n
g.x = d
n.o = d
i.v = k
i.s = a
d.v = k
d.s = l
assert g.x.v.s.s.s.z.z.o.s.txt == "a"