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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.y: H = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: B = None
        self.r: E = None
        self.x: E = None
        self.w: A = None
        self.u: C = None
        self.v: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: D = None
        self.y: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.y: H = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: B = None
        self.r: E = None
        self.x: E = None
        self.w: A = None
        self.u: C = None
        self.v: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: D = None
        self.y: E = None
        self.txt = txt

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

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