class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: I = None
        self.p: I = None
        self.w: H = None
        self.x: G = None
        self.o: D = None
        self.q: D = None
        self.t: G = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = None
        self.t: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: B = None
        self.o: I = None
        self.u: B = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: C = None
        self.r: A = None
        self.v: J = None
        self.s: F = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: G = None
        self.t: F = None
        self.r: E = None
        self.x: I = None
        self.y: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = None
        self.t: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: B = None
        self.o: I = None
        self.u: B = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: C = None
        self.r: A = None
        self.v: J = None
        self.s: F = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: G = None
        self.t: F = None
        self.r: E = None
        self.x: I = None
        self.y: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.x: E = None
        self.txt = txt

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

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