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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: G = None
        self.s: D = None
        self.z: H = None
        self.t: A = None
        self.o: F = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: A = None
        self.t: G = None
        self.y: H = None
        self.q: B = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: H = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.w: E = None
        self.x: E = None
        self.s: E = None
        self.t: E = None
        self.p: H = None
        self.u: H = None
        self.txt = txt

j = A("j")
e = B("e")
g = C("g")
l = D("l")
n = E("n")
a = F("a")
b = G("b")
d = H("d")
h = B("h")
c = H("c")

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: G = None
        self.s: D = None
        self.z: H = None
        self.t: A = None
        self.o: F = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: A = None
        self.t: G = None
        self.y: H = None
        self.q: B = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: H = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.w: E = None
        self.x: E = None
        self.s: E = None
        self.t: E = None
        self.p: H = None
        self.u: H = None
        self.txt = txt

j = A("j")
e = B("e")
g = C("g")
l = D("l")
n = E("n")
a = F("a")
b = G("b")
d = H("d")
h = B("h")
c = H("c")

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