class A:
    def __init__(self, txt: str):
        self.z: J = None
        self.w: G = None
        self.r: E = None
        self.y: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: C = None
        self.v: J = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: J = None
        self.t: C = None
        self.s: J = None
        self.w: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: J = None
        self.q: A = None
        self.o: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: D = None
        self.o: E = None
        self.w: D = None
        self.q: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: C = None
        self.v: J = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: J = None
        self.t: C = None
        self.s: J = None
        self.w: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: J = None
        self.q: A = None
        self.o: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: D = None
        self.o: E = None
        self.w: D = None
        self.q: F = None
        self.r: F = None
        self.txt = txt

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

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