class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: I = None
        self.y: H = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: A = None
        self.u: H = None
        self.z: J = None
        self.y: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.s: F = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: A = None
        self.u: H = None
        self.z: J = None
        self.y: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.s: F = None
        self.w: F = None
        self.txt = txt

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

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

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