class A:
    def __init__(self, txt: str):
        self.y: J = None
        self.o: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: H = None
        self.t: C = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: C = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: H = None
        self.s: D = None
        self.o: E = None
        self.t: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: F = None
        self.r: G = None
        self.y: B = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: D = None
        self.s: F = None
        self.o: C = None
        self.x: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: H = None
        self.t: C = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: C = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: H = None
        self.s: D = None
        self.o: E = None
        self.t: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: F = None
        self.r: G = None
        self.y: B = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: D = None
        self.s: F = None
        self.o: C = None
        self.x: A = None
        self.txt = txt

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

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

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