Harryxun/stf_run huggingface dataset:
n,m = map(int,input().split())
a = [int(input().replace(" ",""),2) for i in range(n)]
mod = 998244353
cnt = 0
for j in range(m)[::-1]:
  for i in range(cnt,n):
    if a[i] & 1<<j:
      for k in range(n):
        if (i != k) and (a[k] & 1<<j):
          a[k] ^= a[i]
      a[i],a[cnt] = a[cnt],a[i]
      cnt += 1
ans = pow(2,n+m-2*cnt,mod)*pow(2,cnt-1,mod)*(pow(2,cnt,mod)-1)%mod
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
a = [int(input().replace(" ",""),2) for i in range(n)]
mod = 998244353
cnt = 0
for j in range(m)[::-1]:
  for i in range(cnt,n):
    if a[i] & 1<<j:
      for k in range(n):
        if (i != k) and (a[k] & 1<<j):
          a[k] ^= a[i]
      a[i],a[cnt] = a[cnt],a[i]
      cnt += 1
if cnt == 0:
  print(0)
else:
  ans = pow(2,n+m-2*cnt,mod)*pow(2,cnt-1,mod)*(pow(2,cnt,mod)-1)%mod
  print(ans)
#!/usr/bin/env python

import sys

s= sys.stdin.readline()
#
m0 = 0
mmap= []
for i in range(6):
    b = 10**i % 13
    mmap.append( [ (b*i)%13 for i in range(10) ] )
#
dp= [ 0 for i in range(13) ]
for i,c in enumerate(reversed(s)):
    tmp  = dp.copy()
    if i==0: tmp[0]= 1
    #
    if c=="?":
        bset = mmap[i%6][1:]
        for m in range(13):
            num= tmp[m]
            if num==0: continue
            for b in bset:
                idx= (m+b)%13
                dp[idx]+= num
    else:
        b= mmap[i%6][int(c)]
        for m in range(13):
            idx= (m+b)%13
            dp[idx]= tmp[m]
#
print(dp[5])


### FIXED CODE ###

import sys
 
s= sys.stdin.readline().strip()
#
MOD=10**9+7
mmap= []
for i in range(6):
    b = 10**i % 13
    mmap.append( [ [ (b*i+j)%13 for i in range(1,10) ] for j in range(13) ] )
#
dp= [ 0 ] * 13
dp[0] = 1
j= 0
for c in reversed(s):
    tmp = dp.copy()
    #
    if c=="0": pass
    elif c=="?":
        bset = mmap[j]
        for m,num in enumerate(tmp):
            if num==0: continue
            for idx in bset[m]: dp[idx]+=num
        #
        for i in range(13): dp[i]%=MOD
    else:
        b= mmap[j][0][int(c)-1]
        for m in range(13):
            idx= (m+b)%13
            dp[idx]= tmp[m]
    #
    if j==5: j=0
    else: j+=1
#
print(dp[5])
b = input()
let = 'ATGC'
prev = b[0]
high = 0
if prev in let:
    leng = 1
    high = 1
for i in range(1,len(b)):
    if leng == 0 and b[i] in let:
        leng = 1
    if b[i] in let and prev in let:
        print(b[i])
        leng += 1
    else:
        if leng > high:
            high = leng
    prev = b[i]

print(high)

### FIXED CODE ###

b = input()
let = 'ATGC'
prev = b[0]
high = 0
leng = 0
stop = False

if prev in let:
    leng = 1
    high = 1
    
for i in range(1,len(b)):
    if leng == 0 and b[i] in let:
        leng = 1
    if b[i] in let and prev in let:
        leng += 1
        stop = False
    else:
        stop = True
        if leng > high:
            high = leng
            leng = 0
    prev = b[i]
    
if not stop:
    if leng > high:
        high = leng
    
print(high)
N, M = [int(i) for i in input().split()]

dp = [0] * (N + 1)
dp[0] = 1
b = 1
f = FalseN, M = [int(i) for i in input().split()]

dp = [0] * (N + 1)
dp[0] = 1
b = 1
f = False
for _ in range(M):
    a = int(input())
    if a - b == 1:
        f = True
        break
    dp[a] = -1
    b = a

if f:
    ans = 0
elif len(dp) == 2:
    if dp[1] == -1:
        ans = 0
    else:
        ans = 1
else:
    MOD = 10**9 + 7
    
    if dp[1] != -1:
        dp[1] = 1
    for i in range(2, N + 1):
        if dp[i] != -1:
            s = 0 if dp[i-2] == -1 else (dp[i-2] % MOD)
            p = 0 if dp[i-1] == -1 else (dp[i-1] % MOD)
            dp[i] = s + p
            ans = dp[-1] % MOD
print(ans)

### FIXED CODE ###

N, M = [int(i) for i in input().split()]

dp = [0] * (N + 1)
dp[0] = 1
b = 1
f = False
for _ in range(M):
    a = int(input())
    if a - b == 1:
        f = True
        break
    dp[a] = -1
    b = a

if f:
    ans = 0
elif len(dp) == 2:
    if dp[1] == -1:
        ans = 0
    else:
        ans = 1
else:
    MOD = 10**9 + 7
    
    if dp[1] != -1:
        dp[1] = 1
    for i in range(2, N + 1):
        if dp[i] != -1:
            s = 0 if dp[i-2] == -1 else (dp[i-2] % MOD)
            p = 0 if dp[i-1] == -1 else (dp[i-1] % MOD)
            dp[i] = s + p
            ans = dp[-1] % MOD
print(ans)
# coding: utf-8
import math

num, blue_num, red_num = map(int, input().split())
all_ball = blue_num + red_num
if num == 0 or blue_num == 0:
    print(0)
elif red_num == 0:
    print(num)
else:
    count = int(math.floor(num / all_ball))
    rest = int(num - (count * all_ball))
    if rest <= blue_num:
        blue_rest = rest
    print((count * blue_num) + blue_rest)


### FIXED CODE ###

# coding: utf-8
import math

count = 0
num, blue_num, red_num = map(int, input().split())
all_ball = blue_num + red_num
count = num // all_ball
rest = num % all_ball
print(count * blue_num + min(rest, blue_num))
S = input()
 
ans = 0
if S ='RRR': ans = 3
else:
  if ('RR' in S) ans = 2
  else:
    if('R' in S) ans = 1
    else: ans = 0

print(ans)

### FIXED CODE ###

S = input()
 
ans = 0
if S == 'RRR': ans = 3
else:
  if ('RR' in S): ans = 2
  else:
    if('R' in S): ans = 1
    else: ans = 0
 
print(ans)
card = {}
n = int(raw_input())
for i in xrange(n):
    cards[raw_input] = True
mark = 'SHCD'
for j in mark:
    for n in range(1,14):
        if card not in cards:
            print j + ' ' + n
    

### FIXED CODE ###

cards = {}
n = int(raw_input())
for i in xrange(n):
    cards[raw_input()] = True
for j in 'SHCD':
    for n in xrange(1,14):
        card = j + ' ' + str(n)
        if card not in cards:
            print card
a=int(input())
inport math
b=a/2
c=math.ceil(b)
print(c/a)

### FIXED CODE ###

import math
a=int(input())
b=math.ceil(a/2)
print(b/a)
A,B,N = map(int,input().split())
x = min(N, B-1)
a = A*x//B - A*(x//B)
print(a)


### FIXED CODE ###

K = int(input())
A,B = map(int,input().split())
i=1
while i<=B:
  if K*i>=A and K*i<=B:
    print("OK")
    break
  else:
    i += 1
if i == B+1:
  print("NG")
from math import sqrt
a, b, c = map(int, input().split())
if a + 2*sqrt(a)*sqrt(b) + b < c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from math import ceil

H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
    exit()
even = ceil(H/2)
odd = H-even
ans = H*(W//2) + even*(W%2)

print(max(ans, 1))
import math
from decimal import *
import sympy
a, b, h, m = map(int, input().split())

big = max(30*h, 6*m)
small = min(30*h, 6*m)
gap = min(big - small, 360 - (big - small)) + (m*0.5)


print(format(Decimal(a**2 + b**2 - 2*a*b*sympy.cos(sympy.radians(gap)))**Decimal("0.5"), ".20f"))


### FIXED CODE ###

import math
a, b, h, m = map(int, input().split())

big = max(30*h + (m*0.5), 6*m)
small = min(30*h + (m*0.5), 6*m)
gap = min(big - small, 360 - (big - small))

print(format(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(gap))), ".20f"))
n = int(input())
d = map(int, input().split())
d = list(d)

import statistics
t = len(d) / 2
k_low = statistics.median_low(d)
k_high = statistics.median_high(d)

c = 0
C = 0
for i in d:
    if i < k_low:
        c +=1
    else:
        c+=0
        
if c == t:
    C += 1
else:
    C += 0

c = 0
for i in d:
    if i >= k_high:
        c +=1
    else:
        c+=0
        
if c == t:
    C += 1
else:
    C += 0
    
print(C)

### FIXED CODE ###

S = str(input())
s = list(S)

s0 = s[0]
s1 = s[1]
s2 = s[2]
s3 = s[3]

c0 = S.count(s0)
c1 = S.count(s1)
c2 = S.count(s2)
c3 = S.count(s3)
ct = c0 + c1 + c2 + c3
ct

if ct == 8:
    print('Yes')
else:
    print('No')
from sympy import nextprime,isprime
X=int(input())
print(X if isprime(X) else nextprime(X))

### FIXED CODE ###

import math

X=int(input())

def isprime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    m = int(math.sqrt(n)) +1
    for p in range(3, m, 2): 
        if n % p == 0:
            return False
    return True

def nextprime(n):
    if n < 2:
        return 2
    if n < 7:
        return {2: 3, 3: 5, 4: 5, 5: 7, 6: 7}[n]
    nn = 6*(n//6)
    if nn == n:
        n += 1
        if isprime(n):
            return n
        n += 4
    elif n - nn == 5:
        n += 2
        if isprime(n):
            return n
        n += 4
    else:
        n = nn + 5
    while 1:
        if isprime(n):
            return n
        n += 2
        if isprime(n):
            return n
        n += 4

print(X if isprime(X) else nextprime(X))
S = input()
A = [0 for i in range(2019)]
x = 0
for i in range(len(S)):
    p = i + 1
    a = (int(S[-p]))10**i % 2019
    x = (x+a) % 2019
    A[x] += 1
ans += A[i]
for i in range(2019):
    ans += A[i]*(A[i]-1)//2
print(ans)

### FIXED CODE ###

S = input()
A = [0 for i in range(2019)]
x = 0
q = 1
for i in range(len(S)):
    p = i + 1
    a = (int(S[-p]))
    b = a*q%2019
    x = (x+b) % 2019
    A[x] += 1
    q = q*10%2019
ans = A[0]
for i in range(2019):
    ans += A[i]*(A[i]-1)//2
print(ans)
s=list(input())
n=len(s)
s1=s[:n//2]
s2=s[n//2:]
for i in range(n//2):
  s2=s1[-1]+s2[:-2]
  s1=s1[:-1]
  if s2==s1:
    break
print(len(s1+s2))

### FIXED CODE ###

s=list(input())
n=len(s)
s1=s[:n//2]
s2=s[n//2:]
for i in range(n//2):
  s2=[s1[-1]]+s2[:-2]
  s1=s1[:-1]
  if s2==s1:
    break
print(len(s1+s2))
N = int(input())
A = [int(input()) for _ in range(N)]

dp = [0] * N
prev_i = [-1] * (10**5 + 1)

dp[0] = 1
prev_i[A[0]] = 0

for i in range(1, N):
  a = A[i]
  if prev_i[a] >= 0:
    if prev_i[a] == i - 1:
      dp[i] = dp[i - 1]
    else:
      dp[i] = dp[i - 1] + dp[prev_i[a]]
  else:
    dp[i] = dp[i - 1]
  prev_i[a] = i
  #print(i, dp, prev_i)

print(dp[-1])

### FIXED CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]

MOD = 10**9 + 7

dp = [0] * N
prev_i = [-1] * (2 * 10**5 + 1)

dp[0] = 1
prev_i[A[0]] = 0

for i in range(1, N):
  a = A[i]
  if prev_i[a] >= 0:
    if prev_i[a] == i - 1:
      dp[i] = dp[i - 1]
    else:
      dp[i] = dp[i - 1] + dp[prev_i[a]]
  else:
    dp[i] = dp[i - 1]
  prev_i[a] = i
  #print(i, dp, prev_i)

print(dp[-1] % MOD)
n, m = map(int, input().split())
if 2*m+1 == n:
    for i in range(1, m+1):
        print(f"{i} {n-i}")
else:
    array = [0]*(n+1)
    now = 1
    for i in range(1, m+1):
        while array[now] == 1:
            now += 1
        print(f"{now} {now+i}")
        array[now+i] = 1
        now += 1


### FIXED CODE ###

n, m = map(int, input().split())
center1 = (m+1) // 2
center2 = center1 + m
for i in range(m):
    if i % 2 == 0:
        a = center1 - i // 2
        b = center1 + i // 2 + 1
    else:
        a = center2 - i // 2
        b = center2 + (i+1) // 2 + 1
    print(f"{a} {b}")
n = int(input())
a = []
max_num = -1
mode_max = False
for i in range(n):
    ipt = int(input())
    if ipt == max_num:
        mode_max = True
    else:
        max_num = max(ipt, max_num)
        a.append(ipt)
if mode_max:
    for i in range(n):
        print(max_num)
else:
    a_copy = a[:]
    idx = a.index(max_num)
    a_copy.remove(max_num)
    sub_max = max(a_copy)
    for i in range(n):
        if i == idx:
            print(sub_max)
        else:
            print(max_nums)

### FIXED CODE ###

n = int(input())
a = []
max_num = -1
for i in range(n):
    ipt = int(input())
    if ipt > max_num:
        max_num = max(ipt, max_num)
        idx = i
    a.append(ipt)
a = sorted(a)
if a[-1] == a[-2]:
    for i in range(n):
        print(max_num)
else:
    for i in range(n):
        if i == idx:
            print(a[-2])
        else:
            print(max_num)
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        a: usize,
        b: usize
    }

    println!("{}", std::cmp::min(n * a, b))
}

### FIXED CODE ###

N, A, B = map(int, input().split())
print(min(N * A, B))
s = 0
q = int(n ** .5)
for i in range(1, int(n ** .5) + 1):
	x = n // i
	s += i * (x * (x+1)) / 2
	if x**2 != n:
		y = max(n // (i+1), q)
		s += (i * (i+1) // 2) * ((x * (x+1) // 2) - (y * (y+1) // 2))

print(int(s))

### FIXED CODE ###

n = int(input())
s = 0
for i in range(1, n+1):
	x = n // i
	s += i * (x * (x+1)) / 2 
print(int(s))
x,y,z = int(input()), int(input()),int(input())
temp = x
x = z
z = y
y = temp
print(x, y, z);

### FIXED CODE ###

X, Y, Z = input().split()
A = X
B = Y
C = Z
temp = A
A = B
B = temp
temp = A
A = C
C = temp

print(A, B, C);
n,k = map(int,input().split())
hei_list = []
for i in range(n):
    tmp = int(input())
    hei_list.append(tmp)
hei_list.sort()
for i in range(n-k+1):
    tmp_dist = hei_list[i + k - 1] - hei_list[i]
    if i == 0:
        min_dist = tmp_dist
    elif tmp_dist < min_dist:
        min_dist = tmp_dist
print(min_dist)

### FIXED CODE ###

a = int(input())
str = "Christmas"
for i in range(25 - a):
    str += " Eve"

print(str)
import sys

def gcd(x, y, *val):
    val = [x, y] + list(val)
    val.sort(reverse=True)

    if len(val) == 2:
        mod = val[0] % val[1]
        if mod == 0:
            return val[1]
        elif mod == 1:
            return 1
        else:
            return gcd(val[1], mod)
    else:
        length = len(val)
        if length % 2 == 1:
            val.append(val[-1])

        return gcd(*[gcd(val[i], val[i + 1]) for i in range(0, length, 2)])
        

def main():
    sinputl = sys.stdin.readline

    num = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]

    gcd_max = 1
    input_mem = []

    for i in range(num):
        mem = input.pop(num - 1 - i)
        gcd_max = max(gcd_max, gcd(*input, *input_mem))
        input_mem.append(mem)

    print(gcd_max)



if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def gcd(x, y, *val):
    val = sorted([x, y], reverse=True) + list(val)
    count = len(val)

    if count == 2:
        if val[1] == 0:
            return val[0]

        mod = val[0] % val[1]
        if mod == 0:
            return val[1]
        elif mod == 1:
            return 1
        else:
            return gcd(val[1], mod)
    else:
        if count % 2 == 1:
            val.append(val[-1])

        return gcd(*[gcd(val[i], val[i + 1]) for i in range(0, count, 2)])
        

def main():
    sinputl = sys.stdin.readline

    num = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]

    gcd_max = 1
    input_mem = []

    if num == 2:
        print(max(input))
        return

    gcd_left = [0]
    gcd_right = [0]

    for i in range(num - 1):
        gcd_left.append(gcd(input[i], gcd_left[i]))
        gcd_right.append(gcd(input[-1 - i], gcd_right[i]))

    gcd_right.reverse()
    gcd_list = []

    for i in range(num):
        gcd_list.append(gcd(gcd_left[i], gcd_right[i]))

    print(max(gcd_list))



if __name__ == "__main__":
    main()
import math
def lcm_list(numbers):
    answer=numbers[0]
    for number in numbers:
        answer=(answer*number/math.gcd(answer*number))
    return answer
nm=list(map(int, input().split()))
a=list(map(int, input().split()))
n=nm[0]
m=nm[1]
b=0
while a[0]%2==0:
    for i in range(len(a)):
        if a[i]%2==0:
            a[i]=int(a[i]/2)
        else:
            b=1
            break
if b==1:
    print(0)
else:
    amc=lcm_list(a)
    print(int((m+amc)/(2*amc)))



### FIXED CODE ###

import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
nm=list(map(int, input().split()))
a=list(map(int, input().split()))
n=nm[0]
m=nm[1]
b=0
c=a[0]
dnum=0
while c%2==0:
    dnum+=1
    c=c//2
for i in range(len(a)):
    c=a[i]
    dnum1=0
    while c%2==0:
        dnum1+=1
        c=c//2
    #print(dnum)
    if dnum1!=dnum:
        b=1
        break

#print(a)
if b==1:
    print(0)
else:
    for i in range(len(a)):
        a[i]=a[i]//2
    #print(a)
    amc=lcm_list(a)
    #print(amc)
    # version3.5にてgcdがfractionsからmathに移動した
    print(int((m+amc)/(2*amc)))
a = list(map(int, input().split()))

print(a[0]*a[1] if a[0],a[1]<=9 else -1)

### FIXED CODE ###

a = list(map(int,input().split()))

print(a[0]*a[1] if a[0] <= 9 and a[1] <= 9 else -1)
A,B=int(input())

if B<6:
  print(0)
elif 6<=B<=12:
  print(A/2)
else:
  print(A)



### FIXED CODE ###

A,B=map(int,input().split())

if A<6:
  print(0)
elif 6<=A<=12:
  print(B//2)
else:
  print(B)
N = int(input())
As = []
for i in range(N):
    As.append(int(input())
for j in range(N):
    instAs = As
    instAs.pop(j)
    print(max(instAs)

### FIXED CODE ###

r = int(input())
print(3*r**2)
x , n= map(int,input().split())
p = list(map(int,input().split()))
ans = []
if n == 0:
    print(x)
else:
    for i in range(1,101):
        if i in p:
            pass
        else:
            ans.append(i)
    sa = []
    for i in range(len(ans)):
        sa.append(abs(ans[i]-x))
    MIN=min(sa)
    for i in range(len(ans)):
        if MIN == abs(ans[i]-x):
            print(ans[i])

### FIXED CODE ###

x , n= map(int,input().split())
p = list(map(int,input().split()))
ans = []
if n == 0:
    print(x)
else:
    for i in range(-10,102):
        if i in p:
            pass
        else:
            ans.append(i)
    sa = []
    for i in range(len(ans)):
        sa.append(abs(ans[i]-x))
    MIN=min(sa)
    for i in range(len(ans)):
        if MIN == abs(ans[i]-x):
            print(ans[i])
            break
S=int(input())

def f(n):
	fact = 1
  
	for i in range(1,n+1): 
	    fact = fact * i
	 return fact

def nCr(n,r):
    
    return f(n) / f(r) / f(n-r)

possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
	left=S-3*i
	possibles+=nCr(left+i-1,i-1)
n=10**9+7
print(possibles%n)

### FIXED CODE ###

#import sys
#input = sys.stdin.readline
Q = 10**9+7
def cmb(n,r):
    if n-r < r: r = n-r
    if r == 0: return 1
    denominator = 1                       #分母
    numerator = 1                         #分子
    for i in range(r):
        numerator *= n-i
        numerator %= Q
        denominator *= i+1
        denominator %= Q
    return numerator*pow(denominator, Q-2, Q)%Q
 
def main():
    S = int( input())
    ans = 0
    for i in range(1, S//3+1):
        t = S - i*3
        ans += cmb(t+i-1,i-1)
        ans %= Q
    print(ans)
        
if __name__ == '__main__':
    main()
A, B, C, X = [int(input()) for i in range(4)]
res = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if a * 500 + b * 100 + c * 50 == X:
                res += 1
print(res)

### FIXED CODE ###

N = int(input())
s = [input() for i in range(N)]
print(len(set(s)))
N,K = list(map(int, input().split()))
A = list(map(int, input().split()))
c = [0]*N

idx = 0
stp = 0
ans = 0
while(True):
  stp += 1
  idx = A[idx] - 1
  if c[idx]==0 and idx!=0:
    c[idx] = stp
  else:
    tmp1 = c[idx]
    tmp2 = stp - tmp1
    break
  if stp>=K:
    ans = idx + 1
    break

k1 = K - tmp1
k2 = k1%tmp2

for _ in range(k2):
  idx = A[idx] - 1
if(ans>0):
  print(ans)
else:
  print(idx+1)

### FIXED CODE ###

N,K = list(map(int, input().split()))
A = list(map(int, input().split()))
c = [0]*N

idx = 0
stp = 0
ans = 0
while(True):
  stp += 1
  idx = A[idx] - 1
  if c[idx]==0 and idx!=0:
    c[idx] = stp
  else:
    tmp1 = c[idx]
    tmp2 = stp - tmp1
    break
  if stp>=K:
    ans = idx + 1
    break

if(ans>0):
  print(ans)
else:
  k1 = K - tmp1
  k2 = k1%tmp2
  for _ in range(k2):
    idx = A[idx] - 1
  print(idx+1)
n = int(input())
a = list(map(int, input().split()))

l = [0] * 9

for i in range(n):
    s = min(a[i] // 400, 9)
    l[s] += 1

m = 0
for i in range(len(l) - 1):
    if l[i] != 0:
        m += 1

M = min(9, l[-1] + m)
print(m, M)


### FIXED CODE ###

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

l = [0] * 9

for i in range(n):
    s = min(a[i] // 400, 8)
    l[s] += 1

m = 0
for i in range(len(l) - 1):
    if l[i] != 0:
        m += 1

print(max(m, 1), l[-1] + m)
k=int(input())+1
l=[]
for a in range(1,k):
    for b in range(1,k):
        for c in range(1,k):
            l.append(math.gcd(a,math.gcd(b,c)))
print (sum(l))

### FIXED CODE ###

import math

k=int(input())+1
l=[]
for a in range(1,k):
    for b in range(1,k):
        for c in range(1,k):
            l.append(math.gcd(a,math.gcd(b,c)))
print (sum(l))
n = int(input())
a = list(map(int,input().split()))
ans = 10**9
for ai in range(min(a),max(a)+1):
    w = 0
    for aj in ai:
        w += (ai-aj)**2
    ans = min(w,ans)
print(ans)

### FIXED CODE ###

n = int(input())
sum = 0
for i in range(n+1):
    sum = sum + i
    
print(sum)
d=int(input())
t=int(input())
s=int(input())


if (s*t) >= d :
    print ('Yes')
    
else:
    print ('No')



### FIXED CODE ###

d, t, s = map(int, input().split())

if t * s >= d:
    print("Yes")
else:
    print("No")
D, G = map(int, input().split())
PC = [0]+[list(map(int,input().split())) for _ in range(D)]
print(1e9)

def dfs(d, g):
    # if(d == 0):
    #     return 1e9

    c = min(g//(100*d), PC[d][0])
    s = 100*d*c
    if c == PC[d][0]:
        s += PC[d][1]
    if s<g:
        c += f(d-1, g-s)
    return min(c, f(d-1,g))

print(dfs(D, G))

### FIXED CODE ###

D, G = map(int, input().split())
PC = [0]+[list(map(int,input().split())) for _ in range(D)]

def dfs(d, g):
    if(d == 0):
        return 1e9

    c = min(g//(100*d), PC[d][0])
    s = 100*d*c
    if c == PC[d][0]:
        s += PC[d][1]
    if s<g:
        c += dfs(d-1, g-s)
    return min(c, dfs(d-1,g))

print(dfs(D, G))
s=list(input())
s1=[]
for i in s:
  if (s.index(i)+1)%2!=0:
    s1.append(i)
print(i for i in s1,end="")


### FIXED CODE ###

n=input()
print(n[::2])
# -*- coding: utf-8 -*-
text = string(input())
sum = 700
if text[0] == "o":
    sum += 100
if text[1] == "o":
    sum += 100
if text[2] == "o":
    sum += 100
print(sum)

### FIXED CODE ###

# -*- coding: utf-8 -*-
text = input()
sum = 700
if text[0] == "o":
    sum += 100
if text[1] == "o":
    sum += 100
if text[2] == "o":
    sum += 100
print(sum)
A, B = map(int, input().split())

import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))

### FIXED CODE ###

from fractions import gcd

A, B = map(int, input().split())

print(str((A * B) // gcd(A, B)))
a = int(input())
b = int(input())
c = int(input())

answer = (b + c) % a

print(answer)

### FIXED CODE ###

A, B, C = map(int,input().split())
print(C - min(A-B,C))
from functools import reduce
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)

### FIXED CODE ###

a, b = map(int,input().split())
print(max([a+b,a-b,a*b]))