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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: A = None
        self.o: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.s: H = None
        self.u: B = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: A = None
        self.o: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: G = None
        self.s: H = None
        self.u: B = None
        self.v: D = None
        self.txt = txt

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

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

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