local mod = 998244353 local mfl = math.floor local function bmul(x, y) local x0, y0 = x % 31596, y % 31596 local x1, y1 = mfl(x / 31596), mfl(y / 31596) return (x1 * y1 * 62863 + (x1 * y0 + x0 * y1) * 31596 + x0 * y0) % mod end local n = io.read("*n", "*l") local s = io.read() local t = {} for i = 1, n do t[i] = s:sub(i, i) end for i = 1, n - 1 do if t[i] == t[i + 1] and t[i] ~= "?" then print(0) os.exit() end end for i = 1, n - 2 do if t[i] == t[i + 2] and t[i] ~= "?" then print(0) os.exit() end end local ret = 1 for i = 1, n do if i == 1 then if t[i] == "?" then ret = 26 end elseif i == 2 then if t[i] == "?" then ret = ret * 25 end else if t[i] == "?" then ret = bmul(ret, 24) end end end print(ret)