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

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

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

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

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

h = A("h")
n = B("n")
a = C("a")
k = D("k")
j = E("j")
g = C("g")
c = B("c")
d = E("d")

h.o = d
h.q = k
h.y = n
n.o = a
n.q = j
n.x = k
n.z = d
n.s = c
a.u = d
a.w = g
a.t = h
k.t = c
k.o = a
k.p = h
j.p = k
j.s = a
j.v = a
j.u = d
g.u = j
g.w = a
g.t = h
c.o = g
c.q = d
c.z = d
c.x = k
c.s = n
d.p = k
d.s = a
d.u = j
d.v = g
assert a.w.w.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

h = A("h")
n = B("n")
a = C("a")
k = D("k")
j = E("j")
g = C("g")
c = B("c")
d = E("d")

h.o = d
h.q = k
h.y = n
n.o = a
n.q = j
n.x = k
n.z = d
n.s = c
a.u = d
a.w = g
a.t = h
k.t = c
k.o = a
k.p = h
j.p = k
j.s = a
j.v = a
j.u = d
g.u = j
g.w = a
g.t = h
c.o = g
c.q = d
c.z = d
c.x = k
c.s = n
d.p = k
d.s = a
d.u = j
d.v = g
assert a.w.w.w.t.txt == "h"