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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: H = None
        self.t: J = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: B = None
        self.w: G = None
        self.t: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: H = None
        self.s: I = None
        self.z: J = None
        self.w: J = None
        self.p: F = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.w: E = None
        self.o: B = None
        self.s: C = None
        self.u: D = None
        self.r: G = None
        self.z: G = None
        self.x: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: D = None
        self.w: J = None
        self.s: G = None
        self.q: G = None
        self.z: G = None
        self.t: C = None
        self.o: I = None
        self.x: I = None
        self.v: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: C = None
        self.x: D = None
        self.u: H = None
        self.t: G = None
        self.z: A = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.t: D = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: H = None
        self.t: J = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: B = None
        self.w: G = None
        self.t: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: H = None
        self.s: I = None
        self.z: J = None
        self.w: J = None
        self.p: F = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.w: E = None
        self.o: B = None
        self.s: C = None
        self.u: D = None
        self.r: G = None
        self.z: G = None
        self.x: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: D = None
        self.w: J = None
        self.s: G = None
        self.q: G = None
        self.z: G = None
        self.t: C = None
        self.o: I = None
        self.x: I = None
        self.v: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: C = None
        self.x: D = None
        self.u: H = None
        self.t: G = None
        self.z: A = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.t: D = None
        self.w: A = None
        self.txt = txt

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

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