class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: G = None
        self.z: G = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: J = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: B = None
        self.x: H = None
        self.z: C = None
        self.o: J = None
        self.w: A = None
        self.v: J = None
        self.p: I = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: G = None
        self.x: I = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: G = None
        self.z: G = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: J = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: B = None
        self.x: H = None
        self.z: C = None
        self.o: J = None
        self.w: A = None
        self.v: J = None
        self.p: I = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: G = None
        self.x: I = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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