class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: F = None
        self.v: B = None
        self.r: J = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: H = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: J = None
        self.u: F = None
        self.v: J = None
        self.o: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: H = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: J = None
        self.u: F = None
        self.v: J = None
        self.o: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: B = None
        self.txt = txt

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

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