class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: B = None
        self.v: E = None
        self.t: G = None
        self.s: H = None
        self.y: D = None
        self.o: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: H = None
        self.y: A = None
        self.x: F = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: B = None
        self.v: E = None
        self.t: G = None
        self.s: H = None
        self.y: D = None
        self.o: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: H = None
        self.y: A = None
        self.x: F = None
        self.o: G = None
        self.txt = txt

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

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