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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: I = None
        self.v: E = None
        self.p: F = None
        self.w: I = None
        self.t: D = None
        self.u: D = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: I = None
        self.q: G = None
        self.p: I = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: J = None
        self.x: H = None
        self.r: A = None
        self.v: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: I = None
        self.v: E = None
        self.p: F = None
        self.w: I = None
        self.t: D = None
        self.u: D = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: I = None
        self.q: G = None
        self.p: I = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: J = None
        self.x: H = None
        self.r: A = None
        self.v: H = None
        self.txt = txt

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

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

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