def cmb(n,r,mod):

  if r<0 or r>n:

    return 0

  r=min(r,n-r)

  return g1[n]*g2[r]*g2[n-r]%mod

 

n=int(eval(input()))

mod=998244353



g1=[1,1]

g2=[1,1]

inverse=[0,1]

 

for i in range(2,n+1):

  g1.append((g1[-1]*i)%mod)

  inverse.append((-inverse[mod%i]*(mod//i))%mod)

  g2.append((g2[-1]*inverse[-1])%mod)



a=0

b=1

for i in range(n,n//2,-1):

  a+=cmb(n,i,mod)*b

  a%=mod

  b*=2

  b%=mod

ans=(pow(3,n,mod)-2*a)%mod

print(((ans+mod)%mod))
n=int(eval(input()));l=[0,1];a=0;b=c=1;p=998244353

for i in range(2,n//2+1):

 l+=[l[p%i]*(p-int(p/i))%p]

for i in range(n,n//2,-1):

 a+=b*c%p;b=2*b%p;c=c*i*l[n+1-i]%p

print(((pow(3,n,p)-2*a+p)%p))
def cmb(n, r, mod):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


n = int(eval(input()))
mod = 998244353
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, n + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)
a = 0
b = 1
for i in range(n, n // 2, -1):
    a += cmb(n, i, mod) * b
    a %= mod
    b *= 2
    b %= mod
ans = (pow(3, n, mod) - 2 * a) % mod
print(((ans + mod) % mod))

n = int(eval(input()))
l = [0, 1]
a = 0
b = c = 1
p = 998244353
for i in range(2, n // 2 + 1):
    l += [l[p % i] * (p - int(p / i)) % p]
for i in range(n, n // 2, -1):
    a += b * c % p
    b = 2 * b % p
    c = c * i * l[n + 1 - i] % p
print(((pow(3, n, p) - 2 * a + p) % p))

-def cmb(n, r, mod): -    if r < 0 or r > n: -        return 0 -    r = min(r, n - r) -    return g1[n] * g2[r] * g2[n - r] % mod - - -mod = 998244353 -g1 = [1, 1] -g2 = [1, 1] -inverse = [0, 1] -for i in range(2, n + 1): -    g1.append((g1[-1] * i) % mod) -    inverse.append((-inverse[mod % i] * (mod // i)) % mod) -    g2.append((g2[-1] * inverse[-1]) % mod) +l = [0, 1] -b = 1 +b = c = 1 +p = 998244353 +for i in range(2, n // 2 + 1): +    l += [l[p % i] * (p - int(p / i)) % p] -    a += cmb(n, i, mod) * b -    a %= mod -    b *= 2 -    b %= mod -ans = (pow(3, n, mod) - 2 * a) % mod -print(((ans + mod) % mod)) +    a += b * c % p +    b = 2 * b % p +    c = c * i * l[n + 1 - i] % p +print(((pow(3, n, p) - 2 * a + p) % p))