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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: B = None
        self.x: H = None
        self.r: H = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: E = None
        self.q: G = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: B = None
        self.x: H = None
        self.r: H = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: E = None
        self.q: G = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

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