class A:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: H = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: B = None
        self.s: D = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.v: I = None
        self.s: B = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: E = None
        self.v: H = None
        self.z: G = None
        self.t: C = None
        self.w: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: H = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: B = None
        self.s: D = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.v: I = None
        self.s: B = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: E = None
        self.v: H = None
        self.z: G = None
        self.t: C = None
        self.w: B = None
        self.txt = txt

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

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