Harryxun/stf_run huggingface dataset:
while True:
    try:
        dataset = input()
    except:
        break
    flag = True
    for i in range(10):
        sequence = dataset.replace("=", "+").split("+")
        if i == 0 and any([True if seq[0]=="X" and len(seq) >= 2 else False for seq in sequence]):
            continue
        a, b, c = map(int, [seq.replace("X", str(i)) for seq in sequence[:2]]), sequence[2].replace("X", str(i))
        if a+b == c:
            print(i)
            flag = False
            break
    if flag:
        print("NA")

### FIXED CODE ###

while True:
    try:
        dataset = input()
    except:
        break
    flag = True
    for i in range(10):
        sequence = dataset.replace("=", "+").split("+")
        if i == 0 and any([True if seq[0]=="X" and len(seq) >= 2 else False for seq in sequence]):
            continue
        a, b, c = map(int, [seq.replace("X", str(i)) for seq in sequence])
        if a+b == c:
            print(i)
            flag = False
            break
    if flag:
        print("NA")
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


# show_flg = False
show_flg = True


def main():
    S = input()
    center = len(S) // 2

    if len(S) % 2 == 0:
        c = 1
        while True:
            if S[center - c] == S[center + c] and S[center - c] == S[center - 1]:
                c += 1
            else:
                break
        print(c + center - 1)
    else:
        c = 1
        while True:
            if S[center - c] == S[center + c] and S[center] == S[center - c]:
                c += 1
            else:
                break
        print(c + center)


if __name__ == '__main__':
    main()


### FIXED CODE ###


from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


# show_flg = False
show_flg = True


def main():
    S = input()
    center = len(S) // 2

    if len(S) % 2 == 0:
        c = 1
        while True:
            if (center - 1 + c) < len(S) and S[center - c] == S[center - 1 + c] and S[center - c] == S[center]:
                # if S[center - c] == S[center]:
                # print(c, center - c, center - 1 + c, S[center - c], S[center])
                c += 1
            else:
                # print(c, S[center - c], S[center - 1 + c])
                # c -= 1
                break
        print(c + center - 1)
    else:
        c = 0
        while True:
            if (center + c) < len(S) and S[center - c] == S[center + c] and S[center] == S[center - c]:
                c += 1
            else:
                break
        print(c + center)


if __name__ == '__main__':
    main()
n, k = map(int,input().split())
a = list(map(int,input().split()))
from collections import deque

ans = deque()
ans.appendleft(1)
count = 1
s = -1
zeros = [0]*n

while True:
    if zeros[a[count-1]] == 1:
        s = a[count-1]
        break
    else:
        ans.append(a[count-1])
        zeros[count-1]=1
        count = a[count-1]

ans = list(ans)
if s == -1:
    print(ans[k])
else:
    t = ans.index(s)
    if t >= k:
        print(ans[k])
    else:
        ans = ans[t:]
        print(ans[(k-t)%len(ans)])


### FIXED CODE ###

n, k = map(int,input().split())
a = list(map(int,input().split()))
from collections import deque

ans = deque()
ans.appendleft(1)
count = 1
s = -1
zeros = [0]*n

while True:
    if zeros[a[count-1]-1] == 1:
        s = a[count-1]
        break
    else:
        ans.append(a[count-1])
        zeros[count-1]=1
        count = a[count-1]

ans = list(ans)
if s == -1:
    print(ans[k])
else:
    t = ans.index(s)
    if t >= k:
        print(ans[k])
    else:
        ans = ans[t:]
        print(ans[(k-t)%len(ans)])
def search(x, num):
    nodes.remove(x)
    search_list = []
    for y in edge[x]:
        edge[y].remove(x)
        search_list.append(y)
    for y in search_list:
        if y in nodes:
            num = search(y, num)
    return num + 1


(n,m),*d  = [list(map(int, s.split())) for s in open(0)]

edge = [set() for _ in range(n+1)]
for x in d:
    edge[x[0]].add(x[1])
    edge[x[1]].add(x[0])

nodes = set(range(1,n+1))
ans = 1
for x in range(1,n+1):
    if x not in nodes:
        continue
    tmp = search(x, 0)
    ans = max(tmp, ans)
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(int(1e6))

def search(x, num):
    nodes.remove(x)
#     for y in edge[x]:
#         edge[y].discard(x)
#     for y in list(edge[x]):
    for y in edge[x]:
        if y in nodes:
            num = search(y, num)
    return num + 1

(n,m),*d  = [list(map(int, s.split())) for s in open(0)]

edge = [set() for _ in range(n+1)]
for x in d:
    edge[x[0]].add(x[1])
    edge[x[1]].add(x[0])

nodes = set(range(1,n+1))
ans = 1
for x in list(nodes):
    if x in nodes:
        ans = max(ans, search(x, 0))
print(ans)
import sys


n,m = map(int, input().split())
steps = [True] * (n+1)
for i in range(m):
    steps[int(input())] = False

dp = [0] * (n+1)
dp[0] = 1
dp[1] = 1
dp[2] = 2
"""
for i in range(3, n+1):
    dp[i] = dp[i-2] + dp[i-1]
"""

ans = 1

l = 0
r = 0
idx = 0
finished = 2
while l < len(steps):

    if idx >= len(steps):
        if r-l > finished:
            for i in range(finished+1, r-l+1):
                dp[i] = dp[i-2] + dp[i-1]
                finished = i
        ans *= dp[r-l]
        break

    if steps[idx]:
        r = idx
    else:
        # idx段目が壊れてる
        #次も壊れてるなら終わり
        if steps[idx+1] == False:
            print(0)
            exit()
        else: 
            if r-l > finished:
                for i in range(finished+1, r-l+1):
                    dp[i] = dp[i-2] + dp[i-1]
                    finished = i
            ans *= dp[r-l]
            l = idx+1
            r = idx+1
    idx += 1

print(ans%(10**9+7))

### FIXED CODE ###


import sys


n,m = map(int, input().split())
steps = [True] * (n+1)
for i in range(m):
    steps[int(input())] = False



dp = [0] * (n+1)
dp[0] = 1
dp[1] = 1
if n >= 2:
    dp[2] = 2

## 散弾未満の時
if n == 1:
    if not steps[1]:
        print(0)
    else:
        print(1)
    exit()
elif n == 2:
    if not steps[2]:
        print(0)
        exit()
    else:
        if not steps[1]:
            print(1)
        else:
            print(2)
        exit()


ans = 1

l = 0
r = 0
idx = 0
finished = 2
while l < len(steps):

    if idx >= len(steps):
        if r-l > finished:
            for i in range(finished+1, r-l+1):
                dp[i] = dp[i-2] + dp[i-1]
                finished = i
        ans *= dp[r-l]
        break

    if steps[idx]:
        r = idx
    else:
        # idx段目が壊れてる
        #次も壊れてるなら終わり
        if steps[idx+1] == False:
            print(0)
            exit()
        else: 
            if r-l > finished:
                for i in range(finished+1, r-l+1):
                    dp[i] = dp[i-2] + dp[i-1]
                    finished = i
            ans *= dp[r-l]
            l = idx+1
            r = idx+1
    idx += 1

print(ans%(10**9+7))
n = input().split()
print("ABC" + n)

### FIXED CODE ###

n = input()
print("ABC" + n )
'''
.append(要素) リストに要素を追加
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前
sort()
sorted(reverse=true)
配列の初期化
配列名=[a]*n+[b]*m
Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
from functools import reduce
from operator import mul
from collections import Counter
import itertools
import fractions
import sys
import numpy as np
d = stdin.readline().rstrip().split()
H = int(d[0])
W = int(d[1])
K = int(d[2])

data = []
bCount = 0
result = 0
for el1 in range(H):
    tmp = stdin.readline().rstrip().split()
    d = []
    for el in tmp:
        for el3 in el:
            if el3 == '#':
                bCount += 1
            d.append(el3)
    data.append(d)
tr = []
for i in range(W):
    tr_row = []
    for vector in data:
        tr_row.append(vector[i])
    tr.append(tr_row)
data2 = tr
counter = 0
for el in range(H+W):
    counter += 2**el
for el in range(counter+1):
    bin_str = ''.join(list(reversed(str(format(el, 'b')))))
    poss = []
    count = 0
    for el2 in bin_str:
        if el2 == '1':
            poss.append(count)
        count += 1
    res = 0
    for el2 in poss:
        if el2 >= H:
            el2 -= H
            res += data2[el2].count('#')
        else:
            res += data[el2].count('#')
    if bCount-res == K:
        result += 1

print(result)


### FIXED CODE ###

'''
.append(要素) リストに要素を追加
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前
sort()
sorted(reverse=true)
配列の初期化
配列名=[a]*n+[b]*m
Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
from functools import reduce
from operator import mul
from collections import Counter
import itertools
import fractions
import sys
d = stdin.readline().rstrip().split()
H = int(d[0])
W = int(d[1])
K = int(d[2])

data = []
bCount = 0
result = 0
for el1 in range(H):
    tmp = stdin.readline().rstrip().split()
    d = []
    for el in tmp:
        for el3 in el:
            if el3 == '#':
                bCount += 1
            d.append(el3)
    data.append(d)
datas = copy.deepcopy(data)
counter = 0
for el in range(H+W):
    counter += 2**el
for el in range(counter+1):
    bin_str = ''.join(list(reversed(str(bin(el))[2:])))
    poss = []
    count = 0
    for el2 in bin_str:
        if el2 == '1':
            poss.append(count)
        count += 1
    res = 0
    for el2 in poss:
        if el2 >= H:
            el2 -= H
            for el3 in datas:
                el3[el2] = 'o'
        else:
            datas[el2] = ['o']*W
    for el2 in datas:
        res += el2.count('#')
    if res == K:
        result += 1
    datas = copy.deepcopy(data)
print(result)
n = int(input())
x=[]
y=[]
h=[]
for i in range(0,n):
    a,b,c = map(int,input().split())
    x.append(a)
    y.append(b)
    h.append(c)
size = 101


for i in range(0,size):
    for j in range(0,size):
        tmph=0
        flag = True
        for k in range(0,n):
            if tmph == 0 and h[k] != 0:
                tmph=abs(x[k]-i)+abs(y[k]-j)+h[k]
            break
        for k in range(0,n):
            calch = abs(x[k]-i)+abs(y[k]-j)+h[k]
            if tmph != calch and h[k] != 0:
                flag = False
                break
        if flag == False:
            continue
        elif tmph == 0:
            flag2 = True
            for c in range(0,n):
                if i == x[c] and j == y[c]:
                    flag2 = False
                    break
            if flag2:
                ansx = i
                ansy = j
                ansh = 1
        else:
            ansx=i
            ansy=j
            ansh=tmph

print(ansx,ansy,ansh)


        


### FIXED CODE ###

n = int(input())
x=[]
y=[]
h=[]
for i in range(0,n):
    a,b,c = map(int,input().split())
    x.append(a)
    y.append(b)
    h.append(c)
 
 
 
for i in range(0,101):
    for j in range(0,101):
        tmph=0
        flag = True
        for k in range(0,n):
            if tmph == 0 and h[k] != 0:
                tmph=abs(x[k]-i)+abs(y[k]-j)+h[k]
                break
        for k in range(0,n):
            calch = tmph - abs(x[k]-i)-abs(y[k]-j)
            if h[k] != max(calch,0):
                flag = False
                break
        if flag == False:
            continue
        elif tmph == 0:
            flag2 = True
            for c in range(0,101):
                if i == x[c] and j == y[c]:
                    flag2 = False
                    break
            if flag2:
                ansx = i
                ansy = j
                ansh = 1
        else:
            ansx=i
            ansy=j
            ansh=tmph
 
print(ansx,ansy,ansh)
N = int(input())
if N >=1000:
  print('ABD'
else:
  print('ABC')

### FIXED CODE ###

N = int(input())
if N >=1000:
  print('ABD')
else:
  print('ABC')
def nibutan(f_id,e_id,f_num,count):
    
    
    m_id = int((f_id + e_id) / 2)
    m_num = n_lis[m_id]

    count += 1
    if (f_id > e_id):
        return count
    else:

        if m_num > f_num:
            return(nibutan(f_id,m_id -1,f_num,count))
        elif m_num < f_num:
            return(nibutan(m_id + 1,e_id,f_num,count))
        else:
            return count
                
while True:
    global n_lis

    n = int(input())
    if n == 0:
        break
    n_lis = []
    for i in range(n):
        n_lis.append(int(input()))
    f_n = int(input())
    ans = nibutan(0,n,f_n,0)
    print(ans)

### FIXED CODE ###

def nibutan(f_id,e_id,f_num,count):
    
    
    m_id = int((f_id + e_id) / 2)
    m_num = n_lis[m_id]

   
    if (f_id > e_id):
        return count
    else:
        count += 1

        if m_num > f_num:
            return(nibutan(f_id,m_id -1,f_num,count))
        elif m_num < f_num:
            return(nibutan(m_id + 1,e_id,f_num,count))
        else:
            return count
                
while True:
    global n_lis

    n = int(input())
    if n == 0:
        break
    n_lis = []
    for i in range(n):
        n_lis.append(int(input()))
    f_n = int(input())
    ans = nibutan(0,n - 1,f_n,0)
    print(ans)
a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort(reverse=1)
i=0
while 1>0:
  if i==len(b):
    print("No")
    break
  if m[i]<n[i] or i==len(a):
    print("Yes")
    break
  i+=1

### FIXED CODE ###

a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort(reverse=1)
i=0
while 1>0:
  if i==len(b):
    print("No")
    break
  if i==len(a):
    print("Yes")
    break
  if m[i]<n[i]:
    print("Yes")
    break
  if m[i]>n[i]:
    print("No")
    break
  i+=1
N = int (input ())
S = input()
S = S.replace('a','')
S = S.replace('i','')
S = S.replace('u','')
S = S.replace('e','')
S = S.replace('o','')
print (N-int (len(S)))

### FIXED CODE ###

S = input()
if S=='a' or S=='i' or S=='u' or S=='e' or S=='o':
  print ('vowel')
else:
  print ('consonant')
memo = [[[-1 for i in xrange(101)] for j in xrange(10)] for k in xrange(1001)]
def dfs(rest, now, cnt):
    if rest==0 and now==0:
        return 1
    if now==0 or cnt==-1:
        return 0
    if memo[rest][now][cnt]!=-1:
        return memo[rest][now][cnt]
    memo[rest][now][cnt] = 0
    for i in xrange(min(cnt, rest), -1, -1):
        memo[rest][now][cnt] += dfs(rest-i, now-1, i-1)
    return memo[rest][now][cnt]
while True:
    n, s = map(int, raw_input().split())
    print dfs(s, n, 100)

### FIXED CODE ###

dp = [[0]*(1001) for _ in xrange(10)]
dp[0][0] = 1
for i in xrange(101):
    si1 = 1001-i
    for k in xrange(9, 0, -1):
        dp_k = dp[k]; dp_k1 = dp[k-1]
        for j in xrange(si1):
            dp_k[i+j] += dp_k1[j]
while 1:
    n, s = map(int, raw_input().split())
    if n==0:
        exit(0)
    print dp[n][s]
a=int(input())
list=[]

for i in range(a):
    order=input().split()
    if order[0]=="insert":
        list.append(order[1])
    elif order[0]=="delete":
        list.remove(order[1])
    elif order[0]=="deleteFirst":
        list.pop(0)
    elif order[0]=="deleteLast":
        list.pop(len(list)-1)

print(*list)


### FIXED CODE ###

from collections import deque
a=int(input())
list=deque([])

for i in range(a):
    order=input().split()
    if order[0]=="insert":
        list.appendleft(order[1])
    elif order[0]=="delete":
        if order[1] in list:
            list.remove(order[1])
    elif order[0]=="deleteFirst":
        list.popleft()
    elif order[0]=="deleteLast":
        list.pop()

print(*list)
a, b = min(map(int, input().split()))
print(a) if a <= b else print(a-1)

### FIXED CODE ###

a, b = map(int, input().split())
print(a) if a <= b else print(a-1)
a, b = input().split()
'Even' if a*b % 2 == 0 else 'Odd'

### FIXED CODE ###

a, b = map(int, input().split())
print('Odd' if a*b % 2 else 'Even')
from sys import exit
from collections import deque
# import copy
# import numpy as np
# from collections import deque

n, m, k = map(int, input().split())
a = deque(list(map(int, input().split())))
b = deque(list(map(int, input().split())))

cnt = 0

while k >= a[0] or k >= b[0]:
    if a[0] < b[0]:
        k -= a.popleft()
        cnt += 1

    elif a[0] > b[0]:
        k -= b.popleft()
        cnt += 1
    else:
        for i in range(1, min(len(a), len(b))):
            if a[i] < b[i]:
                for t in range(0, i+1):
                    k -= a.popleft()
                    cnt += 1
                    if k < a[0]:
                        break
                break
            elif a[i] > b[i]:
                for t in range(0, i+1):
                    k -= b.popleft()
                    cnt += 1
                    if k < b[0]:
                        break
                break
        else:
            if len(a) > len(b):
                for i in range(len(a)):
                    k -= a.popleft()
                    cnt += 1
                    if k < a[0]:
                        break
            else:
                for i in range(len(b)):
                    k -= b.popleft()
                    cnt += 1
                    if k < b[0]:
                        break
    if a == deque([]):
        for i in range(len(b)):
            if k < b[0]:
                break
            k -= b.popleft()
            cnt += 1
        break
    if b == deque([]):
        for i in range(len(a)):
            if k < a[0]:
                break
            k -= a.popleft()
            cnt += 1
        break
print(cnt)


### FIXED CODE ###

from sys import exit
import copy
# import numpy as np
from collections import deque

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

cnt = 0


a.insert(0, 0)
b.insert(0, 0)


for i in range(1, n+1):
    a[i] += a[i-1]

for i in range(1, m+1):
    b[i] += b[i-1]

tmp = m
for i in range(n+1):
    for j in range(tmp, -1, -1):
        if a[i] + b[j] <= k:
            cnt = max(cnt, i + j)
            tmp = j
            break


print(cnt)
n=input()
k=int(input())
dp=[[[0]*(k+2) for _ in range(2)] for _ in range(len(n)+1)]
dp[0][0][0]=1
for i,c in enumerate(n):
	for f in range(2):
		for j in range(k+1):
			for l in range(10 if f else int(c)+1):
				dp[i+1][f or l<c][j+(l>0)]+=dp[i][f][j]
print(dp[-1][0][k]+dp[-1][1][k])

### FIXED CODE ###

n=input()
k=int(input())
dp=[[[0]*(k+2) for _ in range(2)] for _ in range(len(n)+1)]
dp[0][0][0]=1
for i,c in enumerate(n):
	c=int(c)
	for f in range(2):
		for j in range(k+1):
			for l in range(10*f or c+1):
				dp[i+1][f or l<c][j+(l>0)]+=dp[i][f][j]
print(dp[-1][0][k]+dp[-1][1][k])
n, k = map(int, input().split())
li = list(input().split())

new_list = sorted(li)

j = 0
i = 0

while i <= k-1:
  j += int(new_list[i])
  i += 1

print(j)

### FIXED CODE ###

alpha = input()

if alpha.isupper():
  print('A')
elif alpha.islower():
  print('a')
a,b,c,k =map(int,input().split())
if abs(a-b) >= 10**8:
  print("Unfair")
else:
  print(a-b if k%2==0 else b-a)0

### FIXED CODE ###

a,b,c,k =map(int,input().split())
if abs(a-b) > 10**18:
  print("Unfair")
else:
  print(a-b if k%2==0 else b-a)
n = int(input())
s = input()
k = int(input())
s_list = list(s) 
for i in range(0 , n) :
    if s_list[i] == s_list[k] :
        s_list[i] = "*"
a = "".join(s_list)
print(a)

### FIXED CODE ###

n = int(input())
s = input()
k = int(input())
s_list = list(s) 
for i in range(0 , n) :
    if s_list[i] != s_list[k-1] :
        s_list[i] = "*"
a = "".join(s_list)
print(a)
N, K = map(int, input().split())

check = [0] * N

for i in range(K):
    d_i = int(input())
    A_i = map(int, input().split())
    for j in A_i:
        check[j] = 1

print(sum(1 for x in check if x == 0))


### FIXED CODE ###

N, K = map(int, input().split())

check = [0] * N

for i in range(K):
    d_i = int(input())
    A_i = map(int, input().split())
    for j in A_i:
        check[j-1] = 1

print(sum(1 for x in check if x == 0))
item = [int(i) for i in input().split()]
print(item[0]*item[1]+" "+2*(item[0]+item[1]))

### FIXED CODE ###

item = [int(i) for i in input().split()]
print(item[0]*item[1],2*(item[0]+item[1]))
from collections import deque

N = int(input())

queue = deque()
queue.append((0,)
while queue:
    s = queue.popleft()
    if len(s) == N:
        print(''.join('abcdefghij'[i] for i in s))
        continue
    for i in range(max(s) + 2):
        queue.append(s + (i,))

### FIXED CODE ###

from collections import deque

N = int(input())

queue = deque()
queue.append((0,))
while queue:
    s = queue.popleft()
    if len(s) == N:
        print(''.join('abcdefghij'[i] for i in s))
        continue
    for i in range(max(s) + 2):
        queue.append(s + (i,))
#inputは文字列として取得
input1=input()
input2=input()
#splitする必要がある
input2=input2.split(" ")

N=int(input1)
D=[int(s) for s in input2]

dp=[[0] * max(D) for i in range(max(D))]

def pow(a,b):
    
    if dp[a-1][b-1]!=0:
        return dp[a-1][b-1]

    else:
        if b==1:
            return a
        else:
            ans=pow(a,b-1)*a
            dp[a-1][b-1]=ans
            return ans

ans=None

if D.count(0)==1 and D[0]==0:

    mul=1
    n=1

    for i in range(1,max(D)+1):
        m=D.count(i)
        mul*=pow(n,m)
        n=m
    
    ans=mul%998244353

else:
    ans=0

print(int(ans))

### FIXED CODE ###

#inputは文字列として取得
input1=input()
input2=input()
#splitする必要がある
input2=input2.split(" ")

N=int(input1)
D=[int(s) for s in input2]

ans=None


if D.count(0)==1 and D[0]==0:

    L=[0]*(max(D)+1)

    for i in range(len(D)):
        L[D[i]]+=1

    mul=1

    for i in range(len(L)-1):
        mul*=L[i]**L[i+1]%998244353
    
    ans=mul%998244353

else:
    ans=0

print(int(ans))
k, a, b = map(int, input().split())

max_change = max(0, (k - (a - 1)) // 2)
print(max(k+1, 1+k-max_change*2 + (b-a)*max_change)

### FIXED CODE ###

k, a, b = map(int, input().split())

max_change = max(0, (k - (a - 1)) // 2)
print(max(k+1, 1+k-max_change*2 + (b-a)*max_change))
length = int(input())  
 
data = ([int(input()) for i in range(length)])

cnt = 0
i = 1
v = 0

while v != 2:
  v = data[i]
  i = v
  cnt += 1
  if cnt >= data[0]: 
    cnt = -1
    break
print(cnt)

### FIXED CODE ###

N = int(input())  
 
data = ([int(input()) for i in range(N)])

data.insert(0, 0)

cnt = 0
i = 1
v = 0

while v != 2:
  v = data[i]
  i = v
  if cnt >= N: 
    cnt = -1
    break
  cnt += 1
  
print(cnt)
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    for j in range(n):
        if a[j] == (i+1):
            if (i+1) != n:
                print(j+1, end = " ")
            else:
                print(j+1)


### FIXED CODE ###

n = int(input())
if n == 1:
    print(1)
elif n % 2 == 0:
    print(0.5)
else:
    print((n+1)/(2*n))