class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: C = None
        self.s: H = None
        self.r: G = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: A = None
        self.x: H = None
        self.v: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: H = None
        self.q: B = None
        self.w: B = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: H = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.o: G = None
        self.v: B = None
        self.s: A = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

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

i = A("i")
h = B("h")
k = C("k")
g = D("g")
c = E("c")
n = F("n")
d = G("d")
a = H("a")

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: A = None
        self.x: H = None
        self.v: E = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: H = None
        self.q: B = None
        self.w: B = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: H = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.o: G = None
        self.v: B = None
        self.s: A = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

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

i = A("i")
h = B("h")
k = C("k")
g = D("g")
c = E("c")
n = F("n")
d = G("d")
a = H("a")

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