class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.q: I = None
        self.u: B = None
        self.y: B = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.w: H = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: I = None
        self.z: I = None
        self.t: G = None
        self.o: B = None
        self.s: A = None
        self.x: H = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: H = None
        self.v: G = None
        self.z: B = None
        self.t: C = None
        self.r: A = None
        self.y: E = None
        self.u: D = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.w: H = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: I = None
        self.z: I = None
        self.t: G = None
        self.o: B = None
        self.s: A = None
        self.x: H = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: H = None
        self.v: G = None
        self.z: B = None
        self.t: C = None
        self.r: A = None
        self.y: E = None
        self.u: D = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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