class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: J = None
        self.q: G = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.x: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: E = None
        self.o: G = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.x: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: E = None
        self.o: G = None
        self.s: F = None
        self.txt = txt

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

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