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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: A = None
        self.w: B = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: E = None
        self.txt = txt

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

j.q = h
j.w = c
j.r = e
j.v = f
c.u = e
c.w = g
c.p = g
c.v = j
a.v = k
a.t = k
a.p = j
a.q = f
a.y = f
a.o = h
a.z = b
a.s = c
a.x = g
g.t = h
g.r = h
g.q = d
g.x = f
g.v = b
e.x = a
e.u = a
e.q = a
e.p = j
e.w = c
k.s = a
k.p = a
k.o = a
k.v = j
k.z = d
k.x = c
k.r = h
k.u = h
k.w = b
f.t = g
f.p = g
f.z = k
f.y = k
f.v = c
f.q = c
f.s = c
f.o = h
f.x = b
f.w = b
d.p = h
d.q = h
d.y = g
d.t = b
d.v = b
d.u = c
d.r = j
h.r = c
b.u = c
b.t = e
assert k.w.u.v.w.u.p.q.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: B = None
        self.r: E = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: A = None
        self.w: B = None
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: E = None
        self.txt = txt

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

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