There are $$$n + 2$$$ towns located on a coordinate line, numbered from $$$0$$$ to $$$n + 1$$$. The $$$i$$$-th town is located at the point $$$i$$$.You build a radio tower in each of the towns $$$1, 2, \dots, n$$$ with probability $$$\frac{1}{2}$$$ (these events are independent). After that, you want to set the signal power on each tower to some integer from $$$1$$$ to $$$n$$$ (signal powers are not necessarily the same, but also not necessarily different). The signal from a tower located in a town $$$i$$$ with signal power $$$p$$$ reaches every city $$$c$$$ such that $$$|c - i| < p$$$.After building the towers, you want to choose signal powers in such a way that:  towns $$$0$$$ and $$$n + 1$$$ don't get any signal from the radio towers;  towns $$$1, 2, \dots, n$$$ get signal from exactly one radio tower each. For example, if $$$n = 5$$$, and you have built the towers in towns $$$2$$$, $$$4$$$ and $$$5$$$, you may set the signal power of the tower in town $$$2$$$ to $$$2$$$, and the signal power of the towers in towns $$$4$$$ and $$$5$$$ to $$$1$$$. That way, towns $$$0$$$ and $$$n + 1$$$ don't get the signal from any tower, towns $$$1$$$, $$$2$$$ and $$$3$$$ get the signal from the tower in town $$$2$$$, town $$$4$$$ gets the signal from the tower in town $$$4$$$, and town $$$5$$$ gets the signal from the tower in town $$$5$$$.Calculate the probability that, after building the towers, you will have a way to set signal powers to meet all constraints.

The first (and only) line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$).

Print one integer — the probability that there will be a way to set signal powers so that all constraints are met, taken modulo $$$998244353$$$. Formally, the probability can be expressed as an irreducible fraction $$$\frac{x}{y}$$$. You have to print the value of $$$x \cdot y^{-1} \bmod 998244353$$$, where $$$y^{-1}$$$ is an integer such that $$$y \cdot y^{-1} \bmod 998244353 = 1$$$.

NoteThe real answer for the first example is $$$\frac{1}{4}$$$:  with probability $$$\frac{1}{4}$$$, the towers are built in both towns $$$1$$$ and $$$2$$$, so we can set their signal powers to $$$1$$$. The real answer for the second example is $$$\frac{1}{4}$$$:   with probability $$$\frac{1}{8}$$$, the towers are built in towns $$$1$$$, $$$2$$$ and $$$3$$$, so we can set their signal powers to $$$1$$$;  with probability $$$\frac{1}{8}$$$, only one tower in town $$$2$$$ is built, and we can set its signal power to $$$2$$$. The real answer for the third example is $$$\frac{5}{32}$$$. Note that even though the previous explanations used equal signal powers for all towers, it is not necessarily so. For example, if $$$n = 5$$$ and the towers are built in towns $$$2$$$, $$$4$$$ and $$$5$$$, you may set the signal power of the tower in town $$$2$$$ to $$$2$$$, and the signal power of the towers in towns $$$4$$$ and $$$5$$$ to $$$1$$$.

def modinv(a,m):
    b=m
    u=1
    v=0
    while b:
        t=a//b
        a-=t*b
        a,b=b,a
        u-=t*v
        u,v=v,u
    u%=m
    return u
n=int(input())
MOD=998244353
dpsum=[0]*(n+1)
dp=1
for i in range(n):
    dpsum[i+1]=(dp+dpsum[i])%MOD
    dp=dpsum[i]%MOD
ans=dpsum[n]
div=modinv(2,MOD)
for _ in range(n):
    ans*=div
    ans%=MOD
print(ans)

from sys import stdin
mod = 998244353
a = [1,1,1]
n = int(stdin.readline())
while len(a)<n+1:
    a.append(a[-1] + a[-2])
    if a[-1] >=mod:
        a[-1]-=mod
den = pow(2,mod-2,mod)
den = pow(den,n,mod)
print (a[n]*den)%mod

#from math import *
from bisect import *
from collections import *
from random import *
from decimal import *
from random import *
import sys
input=sys.stdin.readline
def inp():
    return int(input())
def st():
    return input().rstrip('\n')
def lis():
    return list(map(int,input().split()))
def ma():
    return map(int,input().split())
t=1
p=998244353
while(t):
    t-=1
    n=inp()
    if(n==1):
        de=pow(2,n,p)
        de=pow(de,p-2,p)
        print(de%p)
        exit(0)
    pr=[1,2]
    for i in range(n-2):
        pr.append((pr[-1]+pr[-2])%p)
    nu=pr[n-2]
    de=pow(2,n,p)
    de=pow(de,p-2,p)
    print(int((nu*de)%p))

MOD = 998244353

class ModInt:
  def __init__(self, x):
    self.x = x % MOD

  def __str__(self):
    return str(self.x)

  __repr__ = __str__

  def __add__(self, other):
    return (
      ModInt(self.x + other.x) if isinstance(other, ModInt) else
      ModInt(self.x + other)
    )

  def __sub__(self, other):
    return (
      ModInt(self.x - other.x) if isinstance(other, ModInt) else
      ModInt(self.x - other)
    )

  def __mul__(self, other):
    return (
      ModInt(self.x * other.x) if isinstance(other, ModInt) else
      ModInt(self.x * other)
    )

  def __truediv__(self, other):
    return (
      ModInt(
        self.x * pow(other.x, MOD - 2, MOD)
      ) if isinstance(other, ModInt) else
      ModInt(self.x * pow(other, MOD - 2, MOD))
    )

  def __pow__(self, other):
    return (
      ModInt(pow(self.x, other.x, MOD)) if isinstance(other, ModInt) else
      ModInt(pow(self.x, other, MOD))
    )

  __radd__ = __add__

  def __rsub__(self, other):
    return (
      ModInt(other.x - self.x) if isinstance(other, ModInt) else
      ModInt(other - self.x)
    )

  __rmul__ = __mul__

  def __rtruediv__(self, other):
    return (
      ModInt(
        other.x * pow(self.x, MOD - 2, MOD)
      ) if isinstance(other, ModInt) else
      ModInt(other * pow(self.x, MOD - 2, MOD))
    )

  def __rpow__(self, other):
    return (
      ModInt(pow(other.x, self.x, MOD)) if isinstance(other, ModInt) else
      ModInt(pow(other, self.x, MOD))
    )
N = int(input())
dp = [ModInt(1)]*(N+1)
for i in range(3,N+1):
  dp[i] = dp[i-1]+dp[i-2]
print(dp[-1]/pow(ModInt(2),N))

def modInverse(a,m):
    m0=m
    y,x=0,1
    if (m==1): return 0
    while(a>1):
        q=a//m
        t=m
        m=a%m
        a=t
        t=y
        y=x-q*y
        x=t
    if(x<0): return(x+m0)
    else: return(x)

n=int(input())
mod=998244353

if(n<=2):
    print(modInverse(pow(2,n,mod),mod))
else:
    l=1
    r=1
    for _ in range(n-2):
        mem=r
        r=(l+r)%mod
        l=mem
    print((r*modInverse(pow(2,n,mod),mod))%mod)

MOD=998244353

n=int(input())

dp=[0 for _ in range(n+1)] #dp[n] is the number of ways to cover n exactly
#dp[n]=dp[n-1]+dp[n-3]+...=dp[n-1]+dp[n-2]

for i in range(1,n+1):
    if i==1:
        dp[i]=1
    elif i==2:
        dp[i]=1
    else:
        dp[i]=dp[i-1]+dp[i-2]
        dp[i]%=MOD

nWays=dp[n]
#print(nWays)
#den=2**n
den=pow(2,n,MOD)

ans=(nWays*pow(den,MOD-2,MOD))%MOD
print(ans)

from sys import stdin,stdout
import math,bisect
from collections import Counter,deque,defaultdict
L=lambda:list(map(int, stdin.readline().strip().split()))
M=lambda:map(int, stdin.readline().strip().split())
I=lambda:int(stdin.readline().strip())
S=lambda:stdin.readline().strip()
C=lambda:stdin.readline().strip().split()
def pr(a):print(" ".join(list(map(str,a))))
#_________________________________________________#

def mp(n,a,m):
    if n==0:
        return 1
    x = mp(n//2,a,m)
    if n%2==1:
        return x*x*a%m
    else:
        return x*x%m

def inv(n,m):
    return mp(m-2,n,m)

def solve():
    n = I()
    m = 998244353
    a = [0]*(n+2)
    a[0] = 1
    a[1] = 1
    for i in range(2,n+1):
        a[i] = (a[i-1]+a[i-2])%m
    ans = inv(mp(n,2,m),m)
    print(ans*a[n-1]%m)

for _ in range(1):
    solve()

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for k in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for k in range(c)] for k in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10**19
MOD = 998244353
EPS = 10**-10

def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD

N = INT()

dp = [0] * (N+1)
acc = [0] * (N+1)
acc[0] = acc[1] = 1
for i in range(1, N+1):
    dp[i] += acc[i-1]
    dp[i] %= MOD
    if i-2 >= 0:
        acc[i] = dp[i] + acc[i-2]
        acc[i] %= MOD
cnt = dp[N]

ans = fermat(cnt, pow(2, N, MOD), MOD)
print(ans)

import sys
input=sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
n=int(input())
m=998244353
if n==1:
    c=1
else:
    a=0
    b=1
    m=998244353
    for i in range(2,n+1):
        c=a+b
        a=b
        b=c
p=pow(2,n,m)
y=pow(p,m-2,m)
print((c*y)%m)

def modinv(n, p):
    return pow(n, p - 2, p)
def main():
    MOD = 998244353
    n = int(input())
    q = modinv(pow(2, n, MOD), MOD)

    fib = [0] * 200005
    fib[1] = 1
    fib[2] = 1

    for i in range(3, 200005):
        fib[i] = fib[i - 1] + fib[i - 2]
        fib[i] %= MOD

    p = fib[n]
    #print(p, q)

    ans = (p % MOD * q % MOD) % MOD
    print(ans)
main()

import math,sys
#from itertools import permutations, combinations
from collections import defaultdict,deque
import bisect as bi
def yes():print('YES')
def no():print('NO')
#sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w');
def I():return (int(sys.stdin.readline()))
def In():return(map(int,sys.stdin.readline().split()))
def Sn():return sys.stdin.readline().strip()
def dict(a):
    d={}
    for x in a:
        if d.get(x,-1)!=-1:
            d[x]+=1
        else:
            d[x]=1
    return d
def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bi.bisect_left(a, x)
    if i != len(a):
        return i
    else:
        return -1
def expo(a, b):
    x, y = 1, a
    while (b > 0):
        if (b & 1):
            x = x * y
        y = y * y
        b >>= 1
    return x
def power(x, y, m):

    if (y == 0):
        return 1

    p = power(x, y // 2, m) % m
    p = (p * p) % m

    if(y % 2 == 0):
        return p
    else:
        return ((x * p) % m)
def modInverse(a, m):
    g = gcd(a, m)
    if (g != 1):
        return -1
    else:
        return(power(a, m - 2, m))
def gcd(a, b):
    if (a == 0):
        return b

    return gcd(b % a, a)
def main():
    try:
        n=I()
        fib=[0,1]
        for i in range(2,n+1):
            temp=(fib[-1]+fib[-2])
            fib[-2]=fib[-1]
            fib[-1]=temp
        ans=(fib[-1]%M*modInverse(expo(2,n),M)%M)%M
        print(ans)

    except:
        pass

M = 998244353
P = 1000000007

if __name__ == '__main__':
    # for _ in range(I()):main()
    for _ in range(1):main()
#End#

#        ******************* All The Best *******************   #

mod = 998244353
n = int(input())
a, b = 0, 1
for i in range(2, n+1):
    a, b = b, (a+b)%mod
print((b * pow(2, n*(mod-2), mod))%mod)

M = 998244353
n=int(input())
a,b=1,1
for i in range(n-1):a,b=b,a+b
print(a*pow(1<<n,M-2,M)%M)

n = int(input())
fib = [0, 1, 1]
total = [1, 2, 4]
MOD = 998244353
for i in range(3, n+1):
    fib.append((fib[i-1] + fib[i-2]) % MOD)
    total.append(total[i-1] * 2 % MOD)

def modInverse(a, m):
    m0 = m
    y = 0
    x = 1

    if (m == 1):
        return 0

    while (a > 1):

        # q is quotient
        q = a // m

        t = m

        # m is remainder now, process
        # same as Euclid's algo
        m = a % m
        a = t
        t = y

        # Update x and y
        y = x - q * y
        x = t

    # Make x positive
    if (x < 0):
        x = x + m0

    return x

print(fib[n] * modInverse(total[n], MOD) % MOD)

mod = 998244353

def fib(n):
    # Declare a list to store
    # Fibonacci numbers.
    f = list()

    # 0th and 1st number of the
    # series are 0 and 1
    f.append(0)
    f.append(1)

    i = 2
    while i < n + 1:
        # Add the previous 2 numbers
        # in the series and store it
        f.append((f[i - 1] + f[i - 2])%mod)
        i += 1
    return f[n]%mod

# Return number of ways to write 'n'
# as sum of odd integers
def countOddWays(n):
    return fib(n)%mod

def modInverse(a, m):
    m0 = m
    y = 0
    x = 1

    if (m == 1):
        return 0

    while (a > 1):
        # q is quotient
        q = a // m

        t = m

        # m is remainder now, process
        # same as Euclid's algo
        m = a % m
        a = t
        t = y

        # Update x and y
        y = x - q * y
        x = t

        # Make x positive
    if (x < 0):
        x = x + m0

    return x

n111 = int(input())

out1 = countOddWays(n111)
base = pow(2,n111,mod)
out2 = modInverse(base,mod)
print((out1*out2)%mod)

n = int(input())

def fun(n):
    v1, v2, v3 = 1, 1, 0    # initialise a matrix [[1,1],[1,0]]
    for rec in bin(n)[3:]:  # perform fast exponentiation of the matrix (quickly raise it to the nth power)
        calc = v2*v2
        v1, v2, v3 = v1*v1+calc, (v1+v3)*v2, calc+v3*v3
        if rec=='1':    v1, v2, v3 = v1+v2, v1, v2
    return v2

# dp = [-1 for i in range(n+1)]
# dp[1]=1
# if n>=2:
#     dp[2]=1
# for i in range(3,n+1):
#     dp[i] = dp[i-1]+dp[i-2]
ans = fun(n)
ans1 = pow(pow(2,n),998244351,998244353)
print((ans1*ans)%998244353)

import math,sys
#from itertools import permutations, combinations
from collections import defaultdict,deque
import bisect as bi
def yes():print('YES')
def no():print('NO')
#sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w');
def I():return (int(sys.stdin.readline()))
def In():return(map(int,sys.stdin.readline().split()))
def Sn():return sys.stdin.readline().strip()
def dict(a):
    d={}
    for x in a:
        if d.get(x,-1)!=-1:
            d[x]+=1
        else:
            d[x]=1
    return d
def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bi.bisect_left(a, x)
    if i != len(a):
        return i
    else:
        return -1
def expo(a, b):
    x, y = 1, a
    while (b > 0):
        if (b & 1):
            x = x * y
        y = y * y
        b >>= 1
    return x
def power(x, y, m):

    if (y == 0):
        return 1

    p = power(x, y // 2, m) % m
    p = (p * p) % m

    if(y % 2 == 0):
        return p
    else:
        return ((x * p) % m)
def modInverse(a, m):
    g = gcd(a, m)
    if (g != 1):
        return -1
    else:
        return(power(a, m - 2, m))
def gcd(a, b):
    if (a == 0):
        return b

    return gcd(b % a, a)
def main():
    try:
        n=I()
        fib=[0,1]
        for i in range(2,n+1):
            temp=(fib[-1]+fib[-2])
            fib[-2]=fib[-1]
            fib[-1]=temp
        ans=(fib[-1]%M*modInverse(power(2,n,M),M)%M)%M
        print(ans)

    except:
        pass

M = 998244353
P = 1000000007

if __name__ == '__main__':
    # for _ in range(I()):main()
    for _ in range(1):main()
#End#

#        ******************* All The Best *******************   #

n = int(input())
m = 998244353
x,y=0,1
for i in range(n-1):
    x,y = y,x+y
    x%=m
    y%=m
r = pow(2,n,m)
print((y*pow(r,m-2,m))%m)

#####################################
import atexit, io, sys , collections, heapq
buffer = io.BytesIO()
sys.stdout = buffer
@atexit.register
def write(): sys.__stdout__.write(buffer.getvalue())
#####################################
mod = 998244353
n = int(raw_input())
def f(n):

	if n <= 1:
		return 1
	so = 1
	se = 1
	for t in range(2, n + 1):
		if t % 2:
			so += se
			so %= mod
		else:
			se += so
			se %= mod
	return se if n % 2 else so

def pow(a,n):
	if n == 0:return 1
	r = pow(a, n//2) % mod
	return r * r * (a if n % 2 else 1) % mod

a = f(n)
b = 1
while(n):
	b *= 2
	b %= mod
	n-=1
	#pow(2,n)
#print a,b
print a * pow(b, mod-2) % mod

#------------------------------warmup----------------------------
# *******************************
# * AUTHOR:  RAJDEEP GHOSH      *
# * NICK  :  Rajdeep2k          *
# * INSTITUTION: IIEST, SHIBPUR *
# *******************************
import os
import sys
from io import BytesIO, IOBase
import math
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

#-------------------game starts now---------------------------------------------------
n = int(input())
x=0
if(n==1 or n==2):
    x=1
elif(n==3):
    x= 2
a=1
b=2
i=4
while(i<n+1):
    c=a+b
    a=b
    b=c
    i+=1
    x=c
y = pow(2, n, 998244353)
print((x*pow(y, 998244351, 998244353))%998244353)

from sys import stdin
mod = 998244353
a = [1,1,1]
n = int(stdin.readline())
while len(a)<n+1:
    a.append(a[-1] + a[-2])
    if a[-1] >=mod:
        a[-1]-=mod
den = pow(2,mod-2,mod)
den = pow(den,n,mod)
print (a[n]*den)%mod

M = 998244353

def inv2(a, mod):
    res, b = 1, mod - 2
    while b != 0:
        if b & 1:
            res = res * a % mod
        a, b = a*a % mod, b >> 1
    return res
n = int(input())
a, b = 1, 1
for i in range(3, n+1):
    a, b = b, (a+b)%M

print((b * inv2(pow(2, n, M), M))%M)

import sys
if sys.subversion[0] == "PyPy":
    import io, atexit
    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()

RS = raw_input
RI = lambda x=int: map(x,RS().split())
RN = lambda x=int: x(RS())
''' ...................................................................... '''

mod = 998244353

n = RN()

dp = [0]*(n+1)
dp[1] = 1

for i in xrange(2,n+1):
    dp[i] = (dp[i-1]+dp[i-2])%mod

den = pow(2,n*(mod-2),mod)
print (dp[-1]*den)%mod

MOD = 998244353

def read_int():
    return int(input())

def read_ints():
    return list(map(int, input().split()))

def print_nums(nums):
    print(" ".join(map(str, nums)))

def gcd(a, b):
    if a == 0:
        return b
    return gcd(b, a % b)

def xgcd(a, b):
    """return (g, x, y) such that a*x + b*y = g = gcd(a, b)"""
    x0, x1, y0, y1 = 0, 1, 1, 0
    while a != 0:
        (q, a), b = divmod(b, a), a
        y0, y1 = y1, y0 - q * y1
        x0, x1 = x1, x0 - q * x1
    return b, x0, y0

def modinv(a, m):
    """return x such that (a * x) % m == 1"""
    g, x, _ = xgcd(a, m)
    if g != 1:
        raise Exception('gcd(a, m) != 1')
    return x % m

def fib(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a

def fib_ns(n):
    assert n >= 1
    f = [0 for _ in range(n + 1)]
    f[0] = 0
    f[1] = 1
    for i in range(2, n + 1):
        f[i] = f[i - 1] + f[i - 2]
    return f

def mod_add(x, y):
    x += y
    while x >= MOD:
        x -= MOD
    while x < 0:
        x += MOD
    return x

def mod_mul(x, y):
    return (x * y) % MOD

def mod_pow(x, y):
    if y == 0:
        return 1
    if y % 2:
        return mod_mul(x, mod_pow(x, y - 1))
    p = mod_pow(x, y // 2)
    return mod_mul(p, p)

def mod_div(x, y):
    return mod_mul(x, mod_pow(y, MOD - 2))

n = read_int()
ans = mod_div(fib(n), mod_pow(2, n))
print(ans)

import sys
import math,bisect
sys.setrecursionlimit(10 ** 6)
from itertools import groupby,accumulate
from heapq import heapify,heappop,heappush
from collections import deque,Counter,defaultdict
I = lambda : int(sys.stdin.readline())
neo = lambda : map(int, sys.stdin.readline().split())
Neo = lambda : list(map(int, sys.stdin.readline().split()))
n = I()
m = 998244353
def fib(n):

    F = [[1, 1],
         [1, 0]]
    if (n == 0):
        return 0
    power(F, n - 1)

    return F[0][0]

def multiply(F, M):

    x = (F[0][0] * M[0][0] +
         F[0][1] * M[1][0])
    y = (F[0][0] * M[0][1] +
         F[0][1] * M[1][1])
    z = (F[1][0] * M[0][0] +
         F[1][1] * M[1][0])
    w = (F[1][0] * M[0][1] +
         F[1][1] * M[1][1])

    F[0][0] = x
    F[0][1] = y
    F[1][0] = z
    F[1][1] = w

# Optimized version of
# power() in method 4
def power(F, n):

    if( n == 0 or n == 1):
        return;
    M = [[1, 1],
         [1, 0]];

    power(F, n // 2)
    multiply(F, F)

    if (n % 2 != 0):
        multiply(F, M)
print((fib(n)*pow(2**n,m-2,m))%m)

import sys
# import math
# import re
# from heapq import *
# from collections import defaultdict as dd
# from collections import OrderedDict as odict
# from collections import Counter as cc
# from collections import deque
sys.setrecursionlimit(3*10**5)#thsis is must
mod = 10**9+7; md = 998244353
# m = 2**32
input = lambda: sys.stdin.readline().strip()
inp = lambda: list(map(int,sys.stdin.readline().strip().split()))
# def C(n,r,mod):
# 	if r>n:
# 		return 0
# 	num = den = 1
# 	for i in range(r):
# 		num = (num*(n-i))%mod
# 		den = (den*(i+1))%mod
# 	return (num*pow(den,mod-2,mod))%mod
# def pfcs(M = 100000):
# 	pfc = [0]*(M+1)
# 	for i in range(2,M+1):
# 		if pfc[i]==0:
# 			for j in range(i,M+1,i):
# 				pfc[j]+=1
# 	return pfc
#______________________________________________________
M = 2*(10**5)+1
dp = [0]*M
dp[1] = 1
dp[2] = 1
for i in range(3,M):
	dp[i] = (dp[i-1]+dp[i-2])%md

# for _ in range(int(input())):
n = int(input())
a = dp[n]
c = pow(2,n,md)
b = pow(c,md-2,md)
print((a*b)%md)

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase

def main():
    n = int(input())
    a,b=1,1
    for i in range(n-2):
        a,b = a+b,a

    N = 998244353
    def exponentiation(bas, exp):
        t = 1;
        while(exp > 0):

            # for cases where exponent
            # is not an even value
            if (exp % 2 != 0):
                t = (t * bas) % N

            bas = (bas * bas) % N
            exp = exp//2;
        return t % N;

    print((a*exponentiation(2,n*(N-2)))%N)

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

"""T=int(input())
for _ in range(0,T):
    n=int(input())
    a,b=map(int,input().split())
    s=input()
    s=[int(x) for x in input().split()]
    for i in range(0,len(s)):
        a,b=map(int,input().split())"""

MOD = 998244353

def powr(n,N):
    temp=1
    while(N>0):
        if(N%2!=0):
            temp=(temp*n)%MOD
        n=(n*n)%MOD
        N=N//2
    return (temp%MOD)

n=int(input())
L=[0,1]
for i in range(2,n+1):
    L.append((L[-1]+L[-2])%MOD)

num = L[-1]%MOD
dem = powr(2,n)%MOD
tt = pow(dem, MOD-2, MOD)%MOD
ans=(num*tt)%MOD
print(ans)

import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	n = mint()
	dp = [1] * (n+1)
	dp1 = [1] * (n+1)
	#dp2 = [0] * (n+1);
	MOD = 998244353
	for i in range(1,n+1):
		dp[i] = dp1[i-1]
		#for j in range(1,n+1,2):
		#	if i - j < 0:
		#		break
		#	dp[i] += dp[i-j]
		#for j in range(0,n+1,2):
		#	if i - j < 0:
		#		break
		#	dp2[i] += dp[i-j]
		dp1[i] = (dp[i] + (dp1[i-2] if i-2 >= 0 else 0)) % MOD
	#dp2[0] = 1
	#print(dp)
	#print(dp1)
	#print(dp2)
	print(dp[n]*pow(2,(MOD-2)*n,MOD)%MOD)

solve()

mod = 998244353
def solve():
    n = int(input())
    deg = n
    f = [0 for i in range(n + 3)]
    f[0] = 0
    f[1] = 1
    f[2] = 1
    for i in range(3, n + 3):
        f[i] = (f[i - 1] + f[i - 2]) % mod
    n = f[n]
    while n % 2 == 0:
        n //= 2
        deg -= 1
    ans = (n * pow(2, deg * (mod - 2), mod)) % mod
    print(ans)
t = 1
#t = int(input())
while t > 0:
    solve()
    t -= 1

n = int(input())
def fib (a):
    ans1 = 1
    ans2 = 1
    t = a
    while t > 0:
        t -= 1
        k = ans1
        ans1 += ans2
        ans2 = k
    return ans1
def binpow (a, b):
    if b == 0:
        return 1
    elif b % 2 == 1:
        return (binpow(a, b - 1) * a) % 998244353
    else:
        k = binpow(a, b / 2)
        return (k * k) % 998244353
m = 0
if n < 4:
    m = n - 1
else:
    m = fib(n - 2)
if n == 1:
    print(499122177)
else:
    l = binpow(2, n)
    ans = (m * binpow(l, 998244351)) % 998244353
    print(ans)

'''Author- Akshit Monga'''
from sys import stdin,stdout
input=stdin.readline
m=998244353
t=1
for _ in range(t):
	n=int(input())
	dp=[0 for x in range(n+1)]
	dp[1]=1
	for i in range(2,n+1):
		dp[i]=((dp[i-1]%m)+(dp[i-2]%m))%m
	q=pow(2,n)
	ans=((dp[-1]%m) * pow(q,m-2,m))%m
	print(ans)

import sys
input = sys.stdin.readline

n = int(input())
mod = 998244353
def modinv(n):
    return pow(n, mod-2, mod)
if n == 1:
    print(modinv(2))
    exit()

u = [0]*(n+1)
u[0] = 1
u[1] = 1
u[2] = 1
k = pow(2,n,mod)
acum = [0]*(n+1)
acum[0] = 1
acum[1] = 2
acum[2] = 3

for i in range(3,n+1):
    acum[i] = (acum[i-2]+acum[i-1])%mod
print((acum[-3]*modinv(k))%mod)

def bp(b, p):
    if p == 1:
        return b
    if p % 2 == 0:
        t = bp(b, p // 2)
        return t * t % q
    else:
        return bp(b, p - 1) * b % q

def inv(x):
    return bp(x, q - 2)

def div(a, b):
    return a * inv(b) % q

n = int(input())
q = 998244353
dp = [0] * (n + 1)
dp[0] = dp[1] = 1
sm0 = 1
sm1 = 1
for i in range(2, n + 1):
    if i % 2 == 0:
        dp[i] = sm1
        sm0 += dp[i]
        sm0 %= q
    else:
        dp[i] = sm0
        sm1 += dp[i]
        sm1 %= q
print(div(dp[n], pow(2, n, q)))

#####################################
import atexit, io, sys , collections, heapq
buffer = io.BytesIO()
sys.stdout = buffer
@atexit.register
def write(): sys.__stdout__.write(buffer.getvalue())
#####################################
mod = 998244353

n = int(raw_input())
mem = [1] * (n+1)
def f(n):

	if n == 1: return 1
	if n == 0: return 1
	if n <= 1:
		return 1
	u,v = 1,1
	ans = 0
	"""
	f(0) = 1
	f(1) = 1
	f(2) = f(1)
	f(3) = f(2) + f(0)
	     = 2
	f(4) = f(3) + f(1)
	     = 2 + 1
	     = 3
	f(5) = f(4) + f(2) + f(0)
	"""
	qo = collections.deque([1])
	so = 1
	qe = collections.deque([1])
	se = 1
	for t in range(2, n + 1):
		if t % 2:
			so += se
			so %= mod
			qo.append(se)
		else:
			se += so
			se %= mod
			qe.append(so)
	return se if n % 2 else so

def pow(a,n):
	if n == 0:return 1
	r = pow(a, n//2) % mod
	return r * r * (a if n % 2 else 1) % mod

a = f(n)
b = pow(2,n)
#print a,b
print a * pow(b, mod-2) % mod

def calculate(p, q):

	mod = 998244353
	expo = 0
	expo = mod - 2

	# Loop to find the value
	# until the expo is not zero
	while (expo):

		# Multiply p with q
		# if expo is odd
		if (expo & 1):
			p = (p * q) % mod
		q = (q * q) % mod

		# Reduce the value of
		# expo by 2
		expo >>= 1

	return p

n=int(input())
a=0;b=1
for j in range(2,n+1):
    a,b=b,a+b
print(calculate(b,2**n))

from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
import math
from collections import *
from functools import reduce,cmp_to_key, lru_cache
from itertools import accumulate
import sys
input = sys.stdin.readline
M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
@lru_cache(None)
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]

fib = [1, 1]
N = 10 ** 5
N *= 2
for i in range(N + 10):
    fib.append((fib[-1] + fib[-2]) % mod)

n = val()
print(fib[n - 1] * inv_mod(pow(2, n, mod)) % mod)

x, y = 0, 0

def extgcd(a, b):
    global x, y

    if b == 0:
        x, y = 1, 0
    else:
        x, y = y, x
        extgcd(b, a % b)
        x, y = y, x
        y -= (a // b) * x

def fib(n):
    f1, f2 = 0, 1
    for _ in range(n):
        f1, f2 = f2, f1 + f2
    return f1

def sol(n):
    a = 2 ** n
    b = 998244353
    extgcd(a, b)

    global x, y
    while x < 0:
        x += b
    print((x * fib(n)) % b)

sol(int(input()))

from sys import stdin
n = int(stdin.readline())
M = 998244353
def fib(n):
    if n == 1:
        return 1
    elif n == 2:
        return 1
    else:
        a,b = 1,1
        for _ in range(n - 2):
            c = (a + b) % M
            a = b
            b = c
        return b % M

print((fib(n) * pow(pow(2, n), M - 2, M)) % M)

MOD = 998_244_353

def pow_mod(a, b):
    result = 1 % MOD
    while b:
        if b & 1:
            result *= a
            result %= MOD
        b >>= 1
        a **= 2
        a %= MOD
    return result

n = int(input())

correct_states_ns_mod = [None] * (n+1)
correct_states_ns_mod[0] = 1 % MOD
prefix_sum_for_even_mod = 1 % MOD
prefix_sum_for_odd_mod = 0
for curr_n in range(1, n+1):
    if curr_n % 2 == 0:
        correct_states_ns_mod[curr_n] = prefix_sum_for_odd_mod
        prefix_sum_for_even_mod += correct_states_ns_mod[curr_n]
        if prefix_sum_for_even_mod >= MOD:
            prefix_sum_for_even_mod -= MOD
    else:
        correct_states_ns_mod[curr_n] = prefix_sum_for_even_mod
        prefix_sum_for_odd_mod += correct_states_ns_mod[curr_n]
        if prefix_sum_for_odd_mod >= MOD:
            prefix_sum_for_odd_mod -= MOD

states_n_mod = 1
for curr_n in range(1, n+1):
    states_n_mod *= 2
    if states_n_mod >= MOD:
        states_n_mod -= MOD

result = correct_states_ns_mod[n] * pow_mod(states_n_mod, MOD-2) % MOD
print(result)

def mod(a,m):
    if a>m:
        return a%m
    return a

def main():
    n = int(input())
    a, b, z, m = 0, 1, 1, 998244353
    while z != n:
        c = mod(a + b, m)
        a = b
        b = c
        z += 1
    xx = pow(pow(2, n, m), m - 2, m)
    print(mod(xx * b, m))
main()

x, y = 0, 0

def extgcd(a, b):
    global x, y

    if b == 0:
        x, y = 1, 0
        return a
    else:
        x, y = y, x
        d = extgcd(b, a % b)
        x, y = y, x
        y -= (a // b) * x
        return d

def fib(n):
    f1, f2 = 0, 1
    for i in range(n):
        tmp = f2
        f2 = f1 + f2
        f1 = tmp
    return f1

def sol(n):
    a = 2 ** n
    b = 998244353
    extgcd(a, b)

    global x, y
    while x < 0:
        x += b
#     print(fib(n))
    print((x * fib(n)) % b)

sol(int(input()))

M = 998244353
n=int(input())
a,b=1,1
for i in range(n-1):a,b=b,a+b
print(a*pow(1<<n,M-2,M)%M)

n = int(input())
MOD = 998244353

def fib(n):
    # Taking 1st two fibonacci nubers as 0 and 1
    if(n==1):
        return 1
    elif(n==2):
        return 1
    elif(n==3):
        return 2

    a=1
    b=2

    for i in range(4, n+1):
        c=a+b
        a=b
        b=c
    # print(c)
    return c

x = fib(n)
y = pow(2, n, MOD)
print((x*pow(y, MOD-2, MOD))%MOD)

import sys
ii = lambda: sys.stdin.readline().strip()
idata = lambda: [int(qw) for qw in ii().split()]

mod = 998244353
def bin_pow(a, b):
    if b == 0:
        return 1
    m = bin_pow(a, b >> 1)
    if b & 1:
        return m * m % mod * a % mod
    return m * m % mod
n = int(ii())
y = bin_pow(bin_pow(2, n), mod - 2)
dp = [0] * (n + 1)
dp[1] = 1
for i in range(2, n + 1):
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod
print(dp[n] * y % mod)

import os
import sys
from io import BytesIO, IOBase
# region fastio
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

def input(): return sys.stdin.readline().rstrip("\r\n")
def getint(): return int(input())
def getints(): return list(map(int, input().split()))
def getint1(): return list(map(lambda x: int(x) - 1, input().split()))

def fib(n):
    if n==1:
        return 1
    elif n==2:
        return 1
    else:
        a = 1
        b = 1
        for i in range(n-2):
            c = a+b
            a = b
            b = c
        return b

def main():
    ###CODE
    m = 998244353
    n = getint()
    v = fib(n) % m
    # den = pow(2,n)
    # den = pow(den,m-2,m)
    den = pow(2,n*m-2*n,m)
    print((v*den) % m)

if __name__ == "__main__":
    main()

n = int(input())
mod = 998244353
dp = [0] * (n + 5)
odd_s = 0
even_s = 1
dp[0] = 1
for i in range(1, n + 5):
    if i % 2 == 0:
        dp[i] = odd_s
        even_s += dp[i]
        even_s %= mod
    else:
        dp[i] = even_s
        odd_s += dp[i]
        odd_s %= mod
bunbo = pow(2, n, mod)
ans = dp[n] * pow(bunbo, mod - 2, mod)
print(ans % mod)

mod = 998244353
def solve():
    n = int(input())
    deg = n
    f = [0 for i in range(n + 3)]
    f[0] = 0
    f[1] = 1
    f[2] = 1
    for i in range(3, n + 3):
        f[i] = (f[i - 1] + f[i - 2]) % mod
    n = f[n]
    while n % 2 == 0:
        n //= 2
        deg -= 1
    ans = (n * pow(2, deg * (mod - 2), mod)) % mod
    print(ans)
t = 1
#t = int(input())
while t > 0:
    solve()
    t -= 1

import io, os
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
n=int(input())
def modInverse(a,m):
    m0=m
    y=0
    x=1
    if (m == 1):
        return 0
    while (a > 1):
        q=a//m
        t=m
        m=a%m
        a=t
        t=y
        y=x-q*y
        x=t
    if x<0:
        x=x+m0
    return x
def power(x,y,z):
    if y==0:
        return 1
    temp=power(x,y//2,z)
    if y%2==0:
        return (temp*temp)%z
    return (x*temp*temp)
z=998244353
b=power(2,n,z)
def fib(n):
    if n<3:
        return 1
    a=1
    b=1
    for i in range(n-2):
        if i%2==0:
            a+=b
        else:
            b+=a
    return max(a,b)
a=fib(n)
a=a%z
c=modInverse(b,z)
a*=c
a%=z
print(a)

import sys
input = lambda:sys.stdin.readline().strip()
mod = 998244353
n = int(input())
f = [0]*(n+1)
f[0] = 0
f[1] = 1
for i in range(2,n+1):
    f[i] = (f[i-1]+f[i-2])%mod
# print(f[n-1],1<<n)
print((f[n]*pow(pow(2,n,mod),mod-2,mod))%mod)

n=input()
dp=[1,1,1,2,3]
mod=998244353

for i in range(n):
    dp.append((dp[-1]+dp[-2])%mod)
rr=dp[n]
cnt=0
while dp[n]%2==0:
    dp[n]/=2
    cnt+=1
g=pow(2,n-cnt,mod)

gg=pow(g,mod-2,mod)
print (dp[n]*gg)%mod

mo = 998244353

def ge(n):
    a = [0] * (n + 5)
    a[1] = 1
    a[2] = 1
    for i in range(3, n + 1):
        a[i] = a[i - 1] + a[i - 2]
        a[i] %= mo
    return a[n]

def min_y(b, n):
  #  print (b, n)
    if (n == 1):
        return b
    if (n % 2 == 0):
        return min_y(b * b % mo, n // 2) % mo
    return b * min_y(b % mo, n - 1) % mo

n = int(input())
get_n = ge(n)
ans = min_y(2, n*(mo - 2) % (mo - 1))

print(get_n * ans % mo)

modulus = 998244353
n = int(input().strip())
fib0, fib1 = 1, 1
for i in range(n - 1):
    fib0, fib1 = fib1, fib0 + fib1
print(((fib0 * pow(2, modulus - n - 1, modulus)) % modulus))

from collections import defaultdict as dd
import sys
mod=998244353
input=sys.stdin.readline
n=int(input())
os=0
es=0
dp=[0]*(n+5)
dp[0]=1
dp[1]=1
dp[2]=1
es=1
os=2
for i in range(3,n+1):
    if(i%2):
        dp[i]=os
        es=(es+dp[i])%mod
    else:
        dp[i]=es
        os=(os+dp[i])%mod
#print(dp)
num=dp[n]
den=pow(2,n,mod)
iden=pow(den,mod-2,mod)
res=(num*iden)%mod
print(res)

n=int(input())
# fib=[0 for _ in range(n+1)]

fib1=1
fib2=1
mod=998244353
fibn=fib2
for i in range(3,n+1):

    fibn=fib1+fib2
    fib1=fib2
    fib2=fibn
x=pow(2,n)

ans=((fibn%mod)*pow(x,mod-2,mod))%mod
print(ans)

mod = 998244353
n = int(input())
a, b = 0, 1
for i in range(2, n+1):
    a, b = b, (a+b)%mod
print((b * pow(2, n*(mod-2), mod))%mod)

from __future__ import division,print_function

mo=998244353
demi=pow(2,mo-2,mo)
quart=pow(4,mo-2,mo)
n=int(input())
P=[1]
sp=0
si=0
for k in range(1,n+1):
    if k%2:
        si=(demi*P[k-1]+si*quart)%mo
        P.append(si)
    else:
        sp= (demi*P[k-1]+sp*quart)%mo
        P.append(sp)
#for k in range(1,n+1):
#    P.append(sum(2**(-i)*P[k-i] for i in range(1,k+1,2)))
print(P[-1])

# from math import gcd

n = int(input())
dp = [1]*(n+2)
MOD=998244353

dp[0]=0;
dp[1]=1;

for i in range(2, n+2):
    dp[i] = dp[i-1] + dp[i-2]
    dp[i]%=MOD

denominator = pow(2, n, MOD)
# g = gcd(dp[n], denominator)
# denominator//=g
# dp[n]//=g
# print(dp[n], denominator)
print(dp[n]*pow(denominator, MOD - 2, MOD) % MOD)

mod=998244353
dp=[0]*(2*10**5+1)
dp[0]=1
dp[1]=1
dp[2]=1
even=2
odd=1
for i in range (3,2*10**5+1):
    if i%2==1:
        dp[i]=even%mod
        odd+=dp[i]
        odd%=mod
    else:
        dp[i]=odd%mod
        even+=dp[i]
        even%=mod
n=int(input())
r=pow(2,n,mod)
dp[n]*=pow(r,mod-2,mod)
print(dp[n]%mod)

import math
n = int(input())
c = 998244353
ans, x, y = 0, 0, 2 ** n % c
if n == 1 or n == 2:
    x = 1
else:
    q, w = 1, 1
    for i in range(3, n + 1):
        q, w = w, (q + w) % c
    x = w
z = math.gcd(x, y)
x //= z
y //= z
ans = pow(y, c - 2, c)
print((ans * x) % c)

M = 998244353
n=int(input())
a,b=1,1
for i in range(n-1):a,b=b,a+b
print(a*pow(1<<n,M-2,M)%M)

import sys
def II():
	return int(sys.stdin.readline())
n =II()
dp=[1,1]
mod=998244353
for i in range(2,n):
    dp.append((dp[-1]+dp[-2])%mod)
ans=dp[-1]
print(ans*pow(pow(2,n,mod),mod-2,mod)%mod)

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    return x % m

import functools

MOD = 998244353
n = int(input())

a, b = 1, 0
p = 2
for _ in range(n-1):
    a, b = a+b, a

    p *= 2
    p %= MOD

print((a * modinv(p, MOD)) % MOD)

mod = 998244353
n=int(input())

if n==1:
    ans = pow(2,mod-2,mod)
    print(ans)
else:
    a=0
    b=1
    for i in range(n-1):
        c = (b+a)%mod
        a = b
        b = c
    ans = pow(2,n,mod)
    ans= pow(ans,mod-2,mod)
    print((ans*c)%mod)

def gcd_extended(a, b):
    # Base Case
    if a == 0:
        return b, 0, 1
    gcd, x1, y1 = gcd_extended(b % a, a)
    # Update x and y using results of recursive call
    x = y1 - (b // a) * x1
    y = x1
    return gcd, x, y

def power(a, n, p):
    if n == 0:
        return 1
    x = power(a, n//2, p)
    x = (x * x) % p
    if n % 2 == 1:
        x = (x * a) % p
    return x % p

p = 998244353
n = int(input())
# n = 200000

rev_2 = gcd_extended(2, p)[1] % p
# a = [1, 0.5]
a = [1, rev_2]
c = [1, rev_2]

powers = [1]
rev_powers = [1]
for i in range(1, 2 * 10 ** 5 + 1):
    powers.append((powers[-1] * 2) % p)
    rev_powers.append((rev_powers[-1] * rev_2) % p)

for k in range(2, n + 1):
    l = 1
    s = 0
    maxp = k if k % 2 == 1 else k - 1

    if k < 3:
        while l <= k:
            s += (a[k - l] * powers[maxp - l]) % p
            l += 2
        c.append(int((s * rev_2 ** (k - 1))) % p)
    else:
        c.append(int(((c[k - 2] * rev_2 * rev_2) + (c[k - 1] * rev_2)) % p))

print(c[n])

mod = 998244353

def fexp(x, y):
    ans = 1
    while y > 0:
        if y & 1 > 0:
            ans = ans * x % mod
        x = x * x % mod
        y >>= 1
    return ans

def inv(x):
    return fexp(x, mod - 2)

def mul(a, b):
    ans = [[0, 0], [0, 0]]
    for i in range(2):
        for j in range(2):
            for k in range(2):
                ans[i][j] = (ans[i][j] + a[i][k] * b[k][j]) % mod
    return ans

def matexp(a, y):
    ans = [[1, 0], [0, 1]]
    while y > 0:
        if y & 1 > 0:
            ans = mul(ans, a)
        a = mul(a, a)
        y >>= 1
    return ans

n = int(input())
if n == 1:
    print(inv(2))
else:
    fib = [[1, 1], [1, 0]]
    mat = matexp(fib, n - 2)
    upper = mat[0][0] + mat[0][1]
    lower = fexp(2, n)
    print(upper * inv(lower) % mod)

n = int(input())
ls, MOD = [1]*(n+1), 998244353
for i in range(3, n+1):
    ls[i] = (ls[i-1]+ls[i-2])%MOD
u = ls[n]*pow(pow(2, n, MOD), MOD-2, MOD)
print(u%MOD)

n = int(input())
x,y=0,1
mod = 998244353
for i in range(n-1):
    x,y = y,x+y
    x %= mod
    y %= mod
t = pow(2,n,mod)
print((y*pow(t,mod-2,mod))%mod)

MOD = 998244353
n = int(input())
mult = pow(2, MOD-1-n, MOD)
a,b=0,1
for i in range(n):
    a,b = b, (a + b) % MOD
print((a * mult) % MOD)

n=int(input())
# fib=[0 for _ in range(n+1)]

fib1=1
fib2=1
mod=998244353
fibn=fib2
for i in range(3,n+1):

    fibn=fib1+fib2
    fib1=fib2
    fib2=fibn
x=pow(2,n)

ans=((fibn%mod)*pow(x,mod-2,mod))%mod
print(ans)

def modInverse(a, m):
    g = gcd(a, m)
    if g != 1:
        return 1
    else:
        return power_fct(a, m - 2, m)

def power_fct(x, y, m):
    if y == 0:
        return 1

    p = power_fct(x, y // 2, m) % m
    p = (p * p) % m

    if y % 2 == 0:
        return p
    else:
        return (x * p) % m

def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)

def radio_towers():
    n = int(input())
    modulo = 998244353

    fib = [1, 0]
    power = 2

    for i in range(1, n):
        fib = [sum(fib) % modulo, fib[0]]
        power = (power * 2) % modulo

    print((modInverse(power, modulo) * fib[0]) % modulo)

if __name__ == "__main__":
    radio_towers()

n = int(input())
mod = 998244353

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

a = 1
b = 1
if n <= 2:
    if n == 1:
        print(modinv(2, mod))
    else:
        print(modinv(4, mod))
    exit(0)
k = 1
for i in range(n):
    k *= 2
    k %= mod

for i in range(2, n):
    a, b = a+b, a

print((a * modinv(k, mod)) % mod)

#####################################
import atexit, io, sys , collections, heapq
buffer = io.BytesIO()
sys.stdout = buffer
@atexit.register
def write(): sys.__stdout__.write(buffer.getvalue())
#####################################
mod = 998244353

n = int(raw_input())
def f(n):
	if n == 1:
		return 1
	if n == 0:
		return 1
	ans = 0
	for u in range(1, n + 1, 2):
		ans += f(n - u)
		ans %= mod
	return ans

def pow(a,n):
	if n == 0:return 1
	r = pow(a, n//2) % mod
	return r * r * (a if n % 2 else 1) % mod

a = f(n)
b = pow(2,n)
print a,b
print a * pow(b, mod-2) % mod

from __future__ import division
from sys import stdin, stdout
# from fractions import gcd
# from math import *
# from operator import mul
# from functools import reduce
# from copy import copy
from collections import deque, defaultdict, Counter

rstr = lambda: stdin.readline().strip()
rstrs = lambda: [str(x) for x in stdin.readline().split()]
rint = lambda: int(stdin.readline())
rints = lambda: [int(x) for x in stdin.readline().split()]
rstr_2d = lambda n: [rstr() for _ in range(n)]
rint_2d = lambda n: [rint() for _ in range(n)]
rints_2d = lambda n: [rints() for _ in range(n)]
pr = lambda args, sep: stdout.write(sep.join(map(str, args)) + '\n')
add = lambda a, b: (a + b) % mod
mult = lambda a, b: (a * b) % mod
div = lambda a, b: mult(a, inv(b))
inv = lambda a: pow(a, mod - 2, mod)
mod = 998244353

n = int(input())
fib = [0] * (n + 1)
fib[0] = fib[1] = 1
for i in range(2, n):
    fib[i] = add(fib[i - 1], fib[i - 2])

print(div(fib[-1], pow(2, n, mod)))

from __future__ import division,print_function

mo=998244353
demi=pow(2,mo-2,mo)
quart=pow(4,mo-2,mo)
n=int(input())
P=[1]
sp=0
si=0
for k in range(1,n+1):
    if k%2:
        si=(demi*P[k-1]+si*quart)%mo
        P.append(si)
    else:
        sp= (demi*P[k-1]+sp*quart)%mo
        P.append(sp)
#for k in range(1,n+1):
#    P.append(sum(2**(-i)*P[k-i] for i in range(1,k+1,2)))
print(P[-1])
print(5/32)

#from math import *
from bisect import *
from collections import *
from random import *
from decimal import *
from random import *
import sys
input=sys.stdin.readline
def inp():
    return int(input())
def st():
    return input().rstrip('\n')
def lis():
    return list(map(int,input().split()))
def ma():
    return map(int,input().split())
t=1
p=998244353
while(t):
    t-=1
    n=inp()
    if(n==1):
        print(1)
        exit(0)
    pr=[1,2]
    for i in range(n-2):
        pr.append((pr[-1]+pr[-2])%p)
    nu=pr[n-2]
    de=pow(2,n,p)
    de=pow(de,p-2,p)
    print((nu*de)%p)

mod=998244353
dp=[0]*(2*10**5+1)
dp[0]=1
dp[1]=1
dp[2]=1
even=2
odd=1
for i in range (3,2*10**5+1):
    if i%2==1:
        dp[i]=even%mod
        odd+=dp[i]
        odd%=mod
    else:
        dp[i]=odd%mod
        even+=dp[i]
        even%=mod
n=int(input())
r=pow(2,n,mod)
r=(r*dp[n])%mod
print(r)

MODP = 998244353

def inv(x, m):
    a, u = 0, 1
    b = m
    while x > 0:
        q = b // x
        x, a, b, u = b % x, u, x, a - q * u
    if b == 1:
        return a % m
    assert False

def result_modp(p, q):
    return ((p % MODP) * inv(q, MODP)) % MODP

def x(n):
    if n in cache:
        return cache[n]

    result = 0
    result += x(n - 1)
    for k in range(2, n // 2 + 2):
        result += x(n + 2 - 2 * k)
        result = result ^ MODP

    cache[n] = result
    return result

if __name__ == '__main__':
    n = int(input())

    denom = 1
    for i in range(n):
        denom = (denom * 2) % MODP

    x = dict()
    x[0] = 1
    x[1] = 1
    x[2] = 1

    for i in range(3, n + 1):
        result = 0
        result += x[i - 1]
        for k in range(2, (i - 1) // 2 + 2):
            result += x[i + 1 - 2 * k]
            result = result % MODP

        x[i] = result

    num = x[n]
    print(x)
    print(result_modp(num, denom))

#!/usr/bin/env python3

import itertools

PRIME = int(998244353)

def ri(string):
    return list(map(int, string.split(' ')))

def power(a, b):
    if b == 0: return 1
    i = 2
    a_power = [a]
    while i <= b:
        a_power.append(a_power[-1]*a_power[-1] % PRIME)
        i *= 2

    bin_b = list(map(int, bin(b)[:1:-1]))
    # print(a_power, bin_b)
    a_power = itertools.compress(a_power, bin_b)
    # print(a_power)
    res = 1
    for p in a_power:
        # print(res, p)
        res = res * p % PRIME
    return res

n = int(input())
# b = int(input())
# print(power(a, b))

sums = []
sums.append(1)
# sums.append(1)
# sums[1] = 1
for i in range(n-1, -1, -2):
    # val = sum(sums) % PRIME
    # print(f'{i}: {val}')
    sums.append(sum(sums) % PRIME)

# print(sums)
x = sums.pop()
# print(x)
y_inv = power(2, n*(PRIME-2))

print(x*y_inv % PRIME)

n = int(input())
MOD = 998244353

def fib(n):
    f = [0, 0, 1, 2, 3]

    for i in range(5, n+1):
        f.append((f[i-1] + f[i-2]) % MOD)
    return f[n]

x = fib(n)
y = pow(2, n, MOD)
print((x*pow(y, MOD-2, MOD)) % MOD)

import math

def modInverse(b,m):
    g = math.gcd(b, m)
    if (g != 1):
        # print("Inverse doesn't exist")
        return -1
    else:
        # If b and m are relatively prime,
        # then modulo inverse is b^(m-2) mode m
        return pow(b, m - 2, m)

# Function to compute a/b under modulo m
def modDivide(a,b,m):
    a = a % m
    inv = modInverse(b,m)
    if(inv == -1):
        print("Division not defined")
    else:
        return (inv*a) % m
for z in range(1):
    n =int(input())
    ans=0
    r= n*(n+1)//6
    p=998244353
    print(modDivide(r,2**n,p))

"""
Code of Ayush Tiwari
Codeforces: servermonk
Codechef: ayush572000

"""
# import sys
# input = sys.stdin.buffer.readline

def modInverse(a, m):

    g = gcd(a, m)

    if (g != 1):
        print("Inverse doesn't exist")

    else:

        return    power(a, m - 2, m)

# To compute x^y under modulo m

def power(x, y, m):

    if (y == 0):
        return 1

    p = power(x, y // 2, m) % m
    p = (p * p) % m

    if(y % 2 == 0):
        return p
    else:
        return ((x * p) % m)

# Function to return gcd of a and b

def gcd(a, b):
    if (a == 0):
        return b

    return gcd(b % a, a)

def solution():

    # This is the main code
    n=int(input())
    p=0
    for i in range(1,n+1):
        p+=min(abs(i-1),abs(n-i))
    p+=1
    q=(modInverse(2**n,998244353))
    print(p*q)

t=1
for _ in range(t):
    solution()

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
import threading
from bisect import bisect_right
from math import gcd,log
from collections import Counter
from pprint import pprint

MOD=998244353
def bin_exp(a,b,MOD):
    ans=1
    while b :
        if b&1:
            ans*=a
            ans%=MOD
        a*=a
        a%=MOD
        b//=2
    return ans

def main(case_no):
    n=int(input())
    fu=[0]*(n+10)
    od=1
    ev=1
    for i in range(2,n+3):
        if (i%2):
            fu[i]=ev
            od+=fu[i]
        else:
            fu[i]=od
            ev+=fu[i]
        od%=MOD
        ev%=MOD
    # print(fu)
    print((fu[n]*bin_exp(bin_exp(2,n,MOD),MOD-2,MOD))%MOD)

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":

    for _ in range(1):
        main(_+1)

mo = 998244353

def ge(n):
    a = [0] * (n + 5)
    a[1] = 1
    a[2] = 1
    for i in range(3, n + 1):
        a[i] = a[i - 1] + a[i - 2]
        a[i] %= mo
    return a[n]

def min_y(b, n):
  #  print (b, n)
    if (n == 1):
        return b
    if (n % 2 == 0):
        return min_y(b * b % mo, n // 2) % mo
    return b * min_y(b % mo, n - 1) % mo

n = int(input())
get_n = ge(n)
ans = 2
st = n * (mo - 2)
while (st != 1):
    if (st % 2 == 0):
        ans = ans * ans % mo
        st //= 2
    else:
        ans = ans % mo
        st -= 1

print(get_n * ans % mo)

import sys
input=sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
n=int(input())
if n==1:
    print(1)
else:
    a=0
    b=1
    m=998244353
    for i in range(2,n+1):
        c=a+b
        a=b
        b=c
    p=pow(2,n,m)
    y=pow(p,m-2,m)
    print((c*y)%m)

n = int(input())
def fib (a):
    ans1 = 1
    ans2 = 1
    t = a
    while t > 0:
        t -= 1
        k = ans1
        ans1 += ans2
        ans2 = k
    return ans1
def binpow (a, b):
    if b == 0:
        return 1
    elif b % 2 == 1:
        return (binpow(a, b - 1) * a) % 998244353
    else:
        k = binpow(a, b / 2)
        return (k * k) % 998244353
m = 0
if n < 4:
    m = n - 1
else:
    m = fib(n - 2)
l = binpow(2, n)
ans = (m * binpow(l, 998244351)) % 998244353
print(ans)

n = int(input())
dp = [1, 1]
for i in range(n - 2):
    dp.append(dp[-1] + dp[-2])
x = dp[-1]
y = 2 ** n
while x % 2 and y % 2 == 0:
    x = x // 2
    y = y // 2

ans = x
for i in range(998244353 - 2):
    ans = (ans * y) % 998244353
print(ans)

import math

# Function to find modulo inverse of b. It returns
# -1 when inverse doesn't
# modInverse works for prime m
def modInverse(b,m):

    return pow(b, m - 2, m)

# Function to compute a/b under modulo m
def modDivide(a,b,m):
    a = a % m
    inv = modInverse(b,m)
    return (inv*a) % m

n = int(input())

curr = 1
prev = 2
if n == 2 :
    fib = 1
elif n==3:
    fib = 2
else:
    for i in range(4,n+1):
        tem = curr
        curr = prev
        prev += tem
    fib = prev
print(modDivide(fib,2**n,998244353))

import math

# Function to find modulo inverse of b. It returns
# -1 when inverse doesn't
# modInverse works for prime m
def modInverse(b,m):
    g = math.gcd(b, m)
    if (g != 1):
        # print("Inverse doesn't exist")
        return -1
    else:
        # If b and m are relatively prime,
        # then modulo inverse is b^(m-2) mode m
        return pow(b, m - 2, m)

# Function to compute a/b under modulo m
def modDivide(a,b,m):
    a = a % m
    inv = modInverse(b,m)
    return (inv*a) % m

n = int(input())

curr = 1
prev = 2
if n == 2 :
    fib = 1
elif n==3:
    fib = 2
else:
    for i in range(4,n+1):
        tem = curr
        curr = prev
        prev += tem
    fib = prev
print(modDivide(fib,2**n,998244353))

"""
    Author - Satwik Tiwari .
    19th NOV , 2020  - Thursday
"""

#===============================================================================================
#importing some useful libraries.

from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from functools import cmp_to_key

# from itertools import *
from heapq import *
from math import gcd, factorial,floor,ceil,sqrt

from copy import deepcopy
from collections import deque

from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect

#==============================================================================================
#fast I/O region
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def testcase(t):
    for pp in range(t):
        solve(pp)
def google(p):
    print('Case #'+str(p)+': ',end='')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    y%=(p-1)  #not so sure about this. used when y>p-1. if p is prime.
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True
inf = pow(10,20)
mod = 998244353
#===============================================================================================
# code here ;))
f = 0
#
# def chck(a,mid):
#     temp = 0
#     global f
#     if(f):
#         mx = max(a)
#         help = a[len(a)-2]
#         to = 0
#         for i in range(len(a)):
#             to+=mx - a[i]
#         to2 = 0
#         for i in range(len(a)):
#             if(a[i] != mx):
#                 to2+=help-a[i]
#         for i in range(len(a)):
#             if(a[i] == mx):
#                 temp+=max(0,to2 - a[i])
#             else:
#                 temp+=max(0,(to - (mx - a[i])) - a[i])
#         if(temp<=mid):
#             return True
#         return False
#
#     else:
#         mx = max(a)
#         to = 0
#         for i in range(len(a)):
#             to+=mx - a[i]
#         for i in range(len(a)):
#             temp+=max((to - (mx - a[i])) - a[i],0)
#         if(temp<=mid):
#             return True
#         return False
#     # if(f):

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

def solve(case):
    n  =int(inp())
    a = 0
    b = modinv(2,mod)
    c = modinv(4,mod)
    help = c
    prev2 = 0
    prev1 = b
    curr = 0
    for i in range(2,n+1):
        # print(b,prev1,help,prev2)
        curr = b*prev1 + help*prev2
        curr%=mod
        prev2 = prev1
        prev1 = curr

    print(curr%mod)

testcase(1)
# testcase(int(inp()))

"""
4
10 0 0
20 1 0
30 0 1
40 1 1
4 1
2 3
1 3
"""

# Design_by_JOKER

from math import *
from cmath import *
from itertools import *
from decimal import *  # su dung voi so thuc
from fractions import *  # su dung voi phan so
from sys import *
#from numpy import *

'''getcontext().prec = x # lay x-1 chu so sau giay phay (thuoc decimal)
Decimal('12.3') la 12.3 nhung Decimal(12.3) la 12.30000000012
Fraction(a) # tra ra phan so bang a (Fraction('1.23') la 123/100 Fraction(1.23) la so khac (thuoc Fraction)
a = complex(c, d) a = c + d(i) (c = a.real, d = a.imag)
a.capitalize() bien ki tu dau cua a(string) thanh chu hoa, a.lower() bien a thanh chu thuong, tuong tu voi a.upper()
a.swapcase() doi nguoc hoa thuong, a.title() bien chu hoa sau dau cach, a.replace('a', 'b', slg)
chr(i) ki tu ma i ord(c) ma ki tu c
a.join['a', 'b', 'c'] = 'a'a'b'a'c, a.strip('a') bo dau va cuoi ki tu 'a'(rstrip, lstrip)
a.split('a', slg = -1) cat theo ki tu 'a' slg lan(rsplit(), lsplit()), a.count('aa', dau = 0, cuoi= len(a)) dem slg
a.startswith('a', dau = 0, cuoi = len(a)) co bat dau bang 'a' ko(tuong tu endswith())
a.index("aa") vi tri dau tien xuat hien (rfind())
input = open(".inp", mode='r')  a = input.readline()
out = open(".out", mode='w') a.index(val) '''

def f(x):
	a = 1
	b = 1
	if x == 1:return 1
	while x - 2 > 0:
		x -= 1
		a, b = b, a + b
	return b

def aa(v, q):
	if q == 1: return v
	r = q // 2
	t = aa(v, r)
	if q % 2: return (((t * t) % 998244353 )*v)%998244353
	return (t*t)%998244353

def cal(a, b):
	a %= 998244353
	b = aa(2, b)
	return (a *((aa(b, 998244351)) % 998244353 ))%998244353

n = int(input())
if n == 1:
	print(cal(1, 1))
elif n == 2:
	print(cal(1, 2))
elif n % 2:
	print(cal(f(n), n))

# Design_by_JOKER

from math import *
from cmath import *
from itertools import *
from decimal import *  # su dung voi so thuc
from fractions import *  # su dung voi phan so
from sys import *
#from numpy import *

'''getcontext().prec = x # lay x-1 chu so sau giay phay (thuoc decimal)
Decimal('12.3') la 12.3 nhung Decimal(12.3) la 12.30000000012
Fraction(a) # tra ra phan so bang a (Fraction('1.23') la 123/100 Fraction(1.23) la so khac (thuoc Fraction)
a = complex(c, d) a = c + d(i) (c = a.real, d = a.imag)
a.capitalize() bien ki tu dau cua a(string) thanh chu hoa, a.lower() bien a thanh chu thuong, tuong tu voi a.upper()
a.swapcase() doi nguoc hoa thuong, a.title() bien chu hoa sau dau cach, a.replace('a', 'b', slg)
chr(i) ki tu ma i ord(c) ma ki tu c
a.join['a', 'b', 'c'] = 'a'a'b'a'c, a.strip('a') bo dau va cuoi ki tu 'a'(rstrip, lstrip)
a.split('a', slg = -1) cat theo ki tu 'a' slg lan(rsplit(), lsplit()), a.count('aa', dau = 0, cuoi= len(a)) dem slg
a.startswith('a', dau = 0, cuoi = len(a)) co bat dau bang 'a' ko(tuong tu endswith())
a.index("aa") vi tri dau tien xuat hien (rfind())
input = open(".inp", mode='r')  a = input.readline()
out = open(".out", mode='w') a.index(val) '''

def f(x):
	a = 1
	b = 1
	while x - 1 > 0:
		x -= 1
		a, b = b, a + b
	return b

def aa(v, q):
	if q == 1: return v
	r = q // 2
	t = aa(v, r)
	if q % 2: return (((t * t) % 998244353 )*v)%998244353
	return (t*t)%998244353

def cal(a, b):
	a %= 998244353
	b = aa(2, b)
	return (a *((aa(b, 998244351)) % 998244353 ))%998244353

n = int(input())
if n == 1:
	print(cal(1, 1))
elif n == 2:
	print(cal(1, 2))
elif n % 2:
	print(cal(f(n), n))

def gcd_extended(a, b):
    # Base Case
    if a == 0:
        return b, 0, 1
    gcd, x1, y1 = gcd_extended(b % a, a)
    # Update x and y using results of recursive
    # call
    x = y1 - (b // a) * x1
    y = x1
    return gcd, x, y

def power(a, n, p):
    if n == 0:
        return 1
    x = power(a, n//2, p)
    x = (x * x) % p
    if n % 2 == 1:
        x = (x * a) % p
    return x % p

t = 1
p = 998244353
# n = int(input())
n = 200000

rev_2 = gcd_extended(2, p)[1] % p
# a = [1, 0.5]
a = [1, rev_2]
# b = [1, 1]
c = [1, rev_2]

# print(rev_2)
# print((rev_2 * 2) % p)

powers = [1]
rev_powers = [1]
for i in range(1, 2 * 10 ** 5 + 1):
    powers.append((powers[-1] * 2) % p)
    rev_powers.append((rev_powers[-1] * rev_2) % p)

for k in range(2, n + 1):
    l = 1
    s = 0

    maxp = k if k % 2 == 1 else k - 1
    # divider = power(2, maxp, p)
    divider = powers[maxp]

    # div_rev = gcd_extended(divider, p)[1]
    div_rev = rev_powers[maxp]

    # a.append(s / divider)
    # a.append(int((s * div_rev)) % p)

    if k < 3:
        while l <= k:
            # s += (a[k - l] * power(2, maxp - l, p)) % p
            s += (a[k - l] * powers[maxp - l]) % p
            l += 2
        c.append(int((s * div_rev)) % p)
    else:
        c.append(int(((c[k - 2] * rev_2 * rev_2) + (c[k - 1] * rev_2)) % p))

    # print(div_rev)
    # print(div_rev2)
    # print('multiplication check')
    # print((divider * div_rev) % p)
    # print((divider * div_rev2) % p)
    # if (divider * div_rev) % p != (divider * div_rev2) % p:
    #     print('lalala')
    # if int((s * div_rev)) % p != int((s * div_rev2) % p):
    #     print(s)

    # try:
    #     b.append(int((s * div_rev) % p))
    #
    #     # print(int((s * div_rev)) % p)
    #     # print(int((s * div_rev2) % p))
    # except ValueError:
    #     print('ValueError')
    #     print(k, s, divider, div_rev)
    #     break

# print(a)
# print(c)
# print(b)
# print(b[n])
# print(a[n])
print(c[n])

n = int(input())
x,y=0,1
mod = 998244353
for i in range(n-1):
    x,y = y,x+y
    x %= mod
    y %= mod
t = pow(2,n,mod)
print((y*pow(t,mod-1,mod))%mod)

# Coder : Hakesh D #
import sys
#input=sys.stdin.readline

from collections import deque
from math import ceil,sqrt,gcd,factorial
from bisect import bisect_right,bisect_left

mod = 998244353
INF = 10**18
NINF = -INF
def I():return int(input())
def MAP():return map(int,input().split())
def LIST():return list(map(int,input().split()))
def modi(x):return pow(x,mod-2,mod)
def lcm(x,y):return (x*y)//gcd(x,y)
def write(l):
    for i in l:
        print(i,end=' ')
    print()
########################################################################################
arr = [0,1]
for i in range(200002):
    arr.append((arr[-1]+arr[-2])%mod)

n = int(input())
iden = modi(pow(2,n,mod))
ans = (arr[n]*iden)%mod
print(arr[n],pow(2,n))
print(ans)

def power(a, b, mod):
    res = 1

    while b:
        if b%2:
            res = (res*a)%mod

        b //= 2
        a = (a*a)%mod

    return res%mod

def divide(a, b, mod):
    return (a * power(b, mod-2, mod)) % mod

n = int(input())
MOD = 998244353

fib = [0, 1]
for i in range(2, 200001):
    fib.append((fib[-1] + fib[-2])%MOD)

divide(fib[n], power(2, n, MOD), MOD)

import sys
input = sys.stdin.readline

n = int(input())
mod = 998244353
def modinv(n):
    return pow(n, mod-2, mod)
if n == 1:
    print(1)
    exit()

u = [0]*(n+1)
u[0] = 1
u[1] = 1
u[2] = 1
k = pow(2,n,mod)
acum = [0]*(n+1)
acum[0] = 1
acum[1] = 2
acum[2] = 3

for i in range(3,n+1):
    acum[i] = (acum[i-2]+acum[i-1])%mod
print((acum[-3]*modinv(k))%mod)

def modinv(n, p):
    return pow(n, p - 2, p)
def main():
    MOD = 998244353
    n = int(input())
    q = modinv(pow(2, n, MOD), MOD)

    fib = [0] * 200005
    fib[1] = 1
    fib[2] = 1

    for i in range(3, 200005):
        fib[i] = fib[i - 1] + fib[i - 2]
        fib[i] %= MOD

    p = fib[n]
    print(p, q)

    ans = (p % MOD * q % MOD) % MOD
    print(ans)
main()

def modInverse(a, m):
    g = gcd(a, m)
    if g != 1:
        return 1
    else:
        return power_fct(a, m - 2, m)

def power_fct(x, y, m):
    if y == 0:
        return 1

    p = power_fct(x, y // 2, m) % m
    p = (p * p) % m

    if y % 2 == 0:
        return p
    else:
        return (x * p) % m

def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)

def radio_towers():
    n = int(input())
    modulo = 998244353

    fib = [1, 1]
    power = 4

    for i in range(2, n):
        fib = [sum(fib) % modulo, fib[0]]
        power = (power * 2) % modulo

    print((modInverse(power, modulo) * fib[0]) % modulo)

if __name__ == "__main__":
    radio_towers()

def modInverse(a, m):
    m0 = m
    y = 0
    x = 1

    if m == 1:
        return 0

    while (a > 1):
        # q is quotient
        q = a // m

        t = m

        m = a % m
        a = t
        t = y

        # Update x and y
        y = x - q * y
        x = t

        # Make x positive
    if x < 0:
        x = x + m0

    return x

def radio_towers():
    n = int(input())
    modulo = 998244353

    fib = [1, 1]
    power = 4

    for i in range(2, n):
        fib = [sum(fib) % modulo, fib[0]]
        power = (power * 2) % modulo

    print((modInverse(power, modulo) * fib[0]) % modulo)

if __name__ == "__main__":
    radio_towers()

def modInverse(a, m):
    m0 = m
    y = 0
    x = 1

    if m == 1:
        return 0

    while (a > 1):
        # q is quotient
        q = a // m

        t = m

        m = a % m
        a = t
        t = y

        # Update x and y
        y = x - q * y
        x = t

        # Make x positive
    if x < 0:
        x = x + m0

    return x

def radio_towers():
    n = int(input())
    modulo = 998244353

    fib = [1, 1]
    power = 4

    for i in range(2, n):
        fib = [sum(fib) % modulo, fib[0] % modulo]
        power = (power * 2) % modulo

    print((modInverse(power, modulo) * fib[0]) % modulo)

if __name__ == "__main__":
    radio_towers()

n = int(input())
mod = 998244353

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

a = 1
b = 1
if n <= 2:
    if n == 1:
        print(modinv(2, mod))
    else:
        print(modinv(4, mod))

k = 1
for i in range(n):
    k *= 2
    k %= mod

for i in range(2, n):
    a, b = a+b, a

print((a * modinv(k, mod)) % mod)