class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.v: D = None
        self.o: E = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

n.x = a
n.q = h
n.v = l
n.o = b
n.s = g
i.z = b
i.o = n
i.u = a
i.t = h
a.t = b
f.u = g
f.p = i
f.o = b
f.z = a
b.w = l
h.x = a
h.q = n
h.v = f
h.o = b
h.s = g
l.u = f
l.p = i
l.o = b
l.z = a
g.u = l
g.p = i
g.o = b
g.z = a
assert g.z.t.w.o.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.v: D = None
        self.o: E = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

n.x = a
n.q = h
n.v = l
n.o = b
n.s = g
i.z = b
i.o = n
i.u = a
i.t = h
a.t = b
f.u = g
f.p = i
f.o = b
f.z = a
b.w = l
h.x = a
h.q = n
h.v = f
h.o = b
h.s = g
l.u = f
l.p = i
l.o = b
l.z = a
g.u = l
g.p = i
g.o = b
g.z = a
assert g.z.t.w.o.w.p.txt == "i"