class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: I = None
        self.x: B = None
        self.q: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: E = None
        self.o: H = None
        self.p: A = None
        self.y: J = None
        self.s: I = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: F = None
        self.x: E = None
        self.z: F = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: C = None
        self.q: E = None
        self.z: E = None
        self.y: F = None
        self.x: D = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: D = None
        self.v: E = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.z: H = None
        self.y: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: E = None
        self.o: H = None
        self.p: A = None
        self.y: J = None
        self.s: I = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: F = None
        self.x: E = None
        self.z: F = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: C = None
        self.q: E = None
        self.z: E = None
        self.y: F = None
        self.x: D = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: D = None
        self.v: E = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.z: H = None
        self.y: G = None
        self.txt = txt

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

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