class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: H = None
        self.w: I = None
        self.r: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: D = None
        self.u: H = None
        self.x: F = None
        self.o: F = None
        self.r: G = None
        self.z: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: A = None
        self.q: J = None
        self.t: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: D = None
        self.u: H = None
        self.x: F = None
        self.o: F = None
        self.r: G = None
        self.z: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: A = None
        self.q: J = None
        self.t: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.v: E = None
        self.txt = txt

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

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

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