Harryxun/stf_run huggingface dataset:
a,b = map(str,input().split())
lst = [a*b,b*a]
new = sorted(lst)
print(new[0])

### FIXED CODE ###

a,b = map(str,input().split())
lst = [a*int(b),b*int(a)]
new = sorted(lst)
print(new[0])
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a<k and b>=K:
  print(0,b-k)
else:
  print(0,0)

### FIXED CODE ###

a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a<k and b-k+a>=0:
  print(0,b-k+a)
else:
  print(0,0)
def check_ans(s,x):
  res=sum(s)
  if res<x:
    return False
  for i in range(0,2**len(s)):
    ans=res
    for j in range(len(s)):
      if (i>>j)%2:
        ans-=s[j]
    if ans==x:
      return True
  return False

S=input()
X,Y=map(int,input().split())
d=1
while S[0]=='F':
  S=S[1:]
  X-=1
nx=[]
ny=[]
X=abs(X)
Y=abs(Y)

while S:
  step=0
  while S and S[0]=='T':
    d*=-1
    S=S[1:]
  while S and S[0]=='F':
    step+=1
    S=S[1:]
  if d==1:
    nx.append(step)
  else:
    ny.append(step)
  if len(S)==1:
    break

if check_ans(nx,X) and check_ans(ny,Y):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import sys

def check_ans(s,x):
  res=[0]
  for i in s:
    res = set([x + i for x in res]) | set([x - i for x in res])
  return x in res

S = sys.stdin.readline().strip()
X,Y=map(int,input().split())
d=1
while S and S[0]=='F':
  S=S[1:]
  X-=1
if len(S)==0:
  if X==0 and Y==0:
    print("Yes")
  else:
    print("No")
  sys.exit()

nx=[]
ny=[]
X=abs(X)
Y=abs(Y)

while S:
  step=0
  while S and S[0]=='T':
    d*=-1
    S=S[1:]
  while S and S[0]=='F':
    step+=1
    S=S[1:]
  if step==0:
    break
  if d==1:
    nx.append(step)
  else:
    ny.append(step)

if check_ans(nx,X) and check_ans(ny,Y):
  print("Yes")
else:
  print("No")
import numpy as np 
n = int(input())
size_ls = list(map(int, input().split()))
size_ls.sort()
csum_size = list(np.cumsum(size_ls))

# とりあえず、与えられたインデックスの生き物が全部食べることをできるか返す関数
def isOK(start):
    res = True
    for i in range(start, n-1):
            if not 2 * csum_size[i] >= size_ls[i + 1]:
                res = False
                break
    return res

ans = 1
for i in range(n-1):
    if isOK(i):
        ans += 1
print(ans)

### FIXED CODE ###

import numpy as np 
n = int(input())
size_ls = list(map(int, input().split()))
size_ls.sort()
csum_size = list(np.cumsum(size_ls))

can_ls = [0] * n
can_ls[-1] = 1
for i in range(n-1):
    if 2 * csum_size[i] >= size_ls[i+1]:
        can_ls[i] = 1
ans = 0
for i in range(n-1,-1,-1):
    if can_ls[i] != 1:
        break
    ans += 1
print(ans)
N,C = map(int,input().split())
tvs = [list(map(int,input().split())) for x in range(N)]
times = [0]*(pow(10,5)+1)
for tv in tvs:
  times[tv[0]] += 1
  times[tv[1]+1] -=1
for i in range(1,len(times)):
  times[i] += times[i-1]
print(max(times))


### FIXED CODE ###

N,C = map(int,input().split())
tvs = [list(map(int,input().split())) for _ in range(N)]
chans = [[] for _ in range(C+1)]
tvs.sort(key=lambda x:x[0])
targets = []
times = [0]*(pow(10,5)+2)

for tv in tvs:
  chans[tv[2]].append([tv[0],tv[1]])

for chan in chans:
  tmp = []
  if len(chan) == 1:
    targets.append(chan[0])
    continue
  for x in range(len(chan)):
    if len(tmp) == 0:
      tmp = chan[x]
      continue
    if chan[x][0] <= tmp[1] + 1:
      tmp[1] = chan[x][1]
      if x == len(chan)-1:
        targets.append(tmp)
    else:
      targets.append(tmp)
      tmp = chan[x]

for target in targets:
  times[target[0]] += 1
  times[target[1]+1] += -1

for j in range(1,pow(10,5)+2):
  times[j] += times[j-1]

print(max(times))
visited = []
current = 0
while 1:
  if K == 0:
    break
  current = towns[current]
  K -= 1
  if current in visited:
    L = 0
    tcurrent = current
    while 1:
      tcurrent = towns[tcurrent]
      L += 1
      if tcurrent == current:
        break
    break
  visited.append(current)

K = K % L
for _ in range(K):
  current = towns[current]
print(current + 1)

### FIXED CODE ###

N, K = map(int, input().split(" "))
towns = list(map(lambda x: int(x)-1, input().split(" ")))
assert len(towns) == N

# print(towns)

score = {0: 0}
current = 0
move = 0
while 1:
  next_town = towns[current]
  move += 1
  # print(f"move {current} to {next_town}")
  if score.get(next_town) is not None:
    # print(f"find loop!")
    loop_move = move - score.get(next_town)
    loop_town = next_town
    until_loop = score.get(next_town)
    # print(f"loop start town : ", loop_town)
    # print(f"cost to start to loop town : ", until_loop)
    # print(f"loop length : ", loop_move)
    break
  score[next_town] = move
  current = next_town

if K < until_loop:
  result = 0
  for k in range(K):
    result = towns[result]
else:
  result = loop_town
  for k in range((K - until_loop) % loop_move):
    result = towns[result]
print(result + 1)
A = int(input())
B = int(input())

print((A-1)*(B-1))


### FIXED CODE ###

A, B = map(int, input().split())
res = (A-1)*(B-1)

print(int(res))
from sys import stdin
import bisect
from itertools import accumulate
import numpy as np

s = stdin.readline().rstrip()
n = int(stdin.readline().rstrip())
li = []

for i in range(1,len(s)+1):
    for j in range(len(s)-i+1):
        li.append(s[j:j+i])
li = list(set(li))
li.sort()
print(li[n-1])

### FIXED CODE ###

from sys import stdin

s = stdin.readline().rstrip()
n = int(stdin.readline().rstrip())
li = []

for i in range(1,6):
    for j in range(len(s)-i+1):
        li.append(s[j:j+i])
li = list(set(li))
li.sort()
print(li[n-1])
import itertools

x = int(input())

y = itertools.combinations(range(-100,100), 2)
i = 0
for n in y:
    if (n[0]**5 - n[1]**5) == x:
        print("{} {}".format(n[0], n[1]))
        break
    elif (n[1]**5 - n[0]**5) == x:
        print("{} {}".format(n[1], n[0]))
        break

### FIXED CODE ###

a = input()

if a == "ABC":
    print("ARC")
else:
    print("ABC")
abc = list(map(int, input().split()))

abc.sort()
ans = 0

while True:
    if abc[0] == abc[1] and abc[1] == abc[2]:
        print(ans)
        break

    if abc[1] != abc[2]:
        abs[0] += 1
        abc[1] += 1
        ans += 1
    elif abc[1] == abc[2] and abc[1] + 1 == abc[0]:
        abc[1] += 1
        abc[2] += 1
        ans += 1
    else:
        abc[0] += 2
        ans += 1
    

### FIXED CODE ###

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

abc.sort()
ans = 0

while True:
    if abc[0] == abc[1] and abc[1] == abc[2]:
        print(ans)
        break

    if abc[1] != abc[2]:
        abc[0] += 1
        abc[1] += 1
        ans += 1
    elif abc[1] == abc[2] and abc[1] + 1 == abc[0]:
        abc[1] += 1
        abc[2] += 1
        ans += 1
    else:
        abc[0] += 2
        ans += 1
n,m=map(int,input().split())#正方形
a= [list(input()) for _ in range(n)] #大
b= [list(input()) for _ in range(m)] #小
m1=0
for i in range(n-m+1): #行
    for j in range(n-m+1): #左からの位置
      if b[i][j+k]==a[i][j] for k in range(n-m+1):m1+=1
        if m1==m:print('Yes') and exit()
        else:pass
      else:print('No')

### FIXED CODE ###

n,m = map(int,input().split()) #要復習
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]
 
for i in range(n-m+1):
    for j in range(n-m+1):
        a1 = [a[k][j:j+m] for k in range(i,i+m)]
        if a1 == b:
            print('Yes')
            exit()

print('No')
l = input()
a = " ".join(l)
print("YES" if int(a) % 4 == 0 else "No")

### FIXED CODE ###



lst = list(input().split())
a = "".join(lst)
print("YES" if int(a) % 4 == 0 else "NO")
tt,ta,at,aa=map(int,input().split())
 
for i in range(100):
 at-=ta 
 if at-ta>0:
    pass
 elif at-ta<=0:
    print("Yes")
    exit()
 tt-=aa
 elif tt-aa>0:
    pass
 elif tt-aa<=0:
    print("No")
    exit()

### FIXED CODE ###

tt,ta,at,aa=map(int,input().split())
 
for i in range(100):
 at-=ta 
 if at>0:
    pass
 elif at<=0:
    print("Yes")
    exit()
 tt-=aa
 if tt>0:
    pass
 elif tt<=0:
    print("No")
    exit()
N=int(input())

if N=1:
    print(1)
elif 2<=N<=3:
    print(2)
elif 4<=N<=7:
    print(4)
elif 8<=N<=15:
    print(8)
elif 16<=N<=31:
    print(16)
elif 32<=N<=64:
    print(32)
else 64<=N<=100:
    print(64)

### FIXED CODE ###

N=int(input())

if N==1:
    print(1)
elif 2<=N<=3:
    print(2)
elif 4<=N<=7:
    print(4)
elif 8<=N<=15:
    print(8)
elif 16<=N<=31:
    print(16)
elif 32<=N<=63:
    print(32)
elif 64<=N<=100:
    print(64)
N, L = map(int, input().split())
input_line1 = [input() for i in range(N)]
input_line2 = []
for i in range(N):
 	input_line2.append(min(input_line1))
    input_line1.remove(min(input_line1))
print("".join(input_line2))
	

### FIXED CODE ###

N, L = map(int, input().split())
input_line1 = [input() for i in range(N)]
input_line2 = []
for i in range(N):
	input_line2.append(min(input_line1))
	input_line1.remove(min(input_line1))
print("".join(input_line2))
N = int(input())
T = N
k = 26
c = 0
while(T - k > 0):
    T -= k
    k *= 26
    c += 1

alph = {}
p = 1
for i in range(97, 97+26):
    alph[str(p%26)] = chr(i)
    p += 1
ans = ""
for i in range(c, -1, -1):
    t = N // (26**i)
    ans += alph[str(t)]
    N -= t*(26**i)
print("".join(ans))

### FIXED CODE ###

N = int(input())
c = 0
P = [N]

alph = {}
p = 1
for i in range(97, 97+26):
    alph[str(p%26)] = chr(i)
    p += 1

ans = []
k = 0
T = N
while(N > 0):
    if k == 0:
        ans.append(alph[str((N // (26**k))%26)])
    else:
        ans.append(alph[str(((N-1)//(26**k)+1)%26)])
    k += 1
    N -= 26**k
print("".join(ans[::-1]))
import itertools
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
nums = [i for i in range(1,n+1)]
fac = [words for words in itertools.permutations(nums)]
ans = abs(fac.index(p) - fac.index(q))
print(ans)


### FIXED CODE ###

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

if K*500>=X:
    print("Yes")
else:
    print("No")
import sys
sys.setrecursionlimit(100000)

N =int(input()) 
H = list(map(int, input().split())) 

memo = [-1]*N 
def func(n,memo): 
  if n == 0: 
    memo[0] = 0 
    return memo[n] 
  elif n == 1: 
    memo[1] = abs(H[1]-H[0]) 
    return memo[n] 
  else: 
    if memo[n] != -1: 
      return memo[n] 
    else: 
      min_c = min(func(n-1,memo)+abs(H[n]-H[n-1]), func(n-2,memo)+abs(H[n]-H[n-2])) 
      memo[n] = min_c 
    return min_c 
  
print(func(N-1,memo)) 

### FIXED CODE ###

N =int(input())
H = list(map(int, input().split()))
#総数Nで、N番目の添字はN-1
flog = 0

#足場iにたどり着くための最小コストをリスト化
mincost= []
for i in range(N):
  if i == 0:
    c = 0
  elif i == 1:
    c = abs(H[1]-H[0])
  else:
    c = min(abs(H[i]-H[i-1])+mincost[i-1],abs(H[i]-H[i-2])+mincost[i-2])
  mincost.append(c)

print(mincost[N-1])
n = int(input())
a = map(int, input().split())

print(max(a) - min(a))

### FIXED CODE ###

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

print(max(a) - min(a))
x,y,z,k = map(int,input().split())
a = list(map(int,input().split())).sort(reverse=True)
b = list(map(int,input().split())).sort(reverse=True)
c = list(map(int,input().split())).sort(reverse=True)

sum_list = []
for a_i in range(x):
    for b_i in range(y):
        for c_i in range(z):
            if a_i*b_i*c_i > k:
                continue
            sum_list.append(a[a_i]+b[b_i]+c[c_i])
sum_list.sort(reverse=True)
for i in range(k):
    print(sum_list[i])

### FIXED CODE ###

x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
sum_list = []
for a_i in range(x):
    for b_i in range(y):
        if a_i*b_i > k:
            break
        for c_i in range(z):
            if a_i*b_i*c_i > k:
                break
            sum_list.append(a[a_i]+b[b_i]+c[c_i])
sum_list.sort(reverse=True)
for i in range(k):
    print(sum_list[i])
from collections import Counter

n, k = map(int, input().split())
a = [int(an) for an in input().split()]
ans = 0
set_a = set(a)
num_of_types = len(set_a)
if num_of_types > k:
  cnt = Counter(a)
  ans = sum(sorted(cnt.values())[: num_of_types - k])

print(ans)

### FIXED CODE ###

print(input().count('1'))
num = int(input())

array = []
for i in range(num):
    array.append(int(input()))

res = -1
if 2 in array:
    judge = array[0]
    roop = 1
    while judge != 2 and roop != 100001:
        roop += 1
        judge = array[judge-1]
        if judge == 2:
            break
if judge == 2:
    res = roop

print(res)

### FIXED CODE ###



num = int(input())

array = []
for i in range(num):
    array.append(int(input()))

res = -1
if 2 in array:
    judge = array[0]
    roop = 1
    while judge != 2 and roop != 100001:
        roop += 1
        judge = array[judge-1]
        if judge == 2:
            break
else:
    judge = 10000000

if judge == 2:
    res = roop

print(res)
def bubble_sort(A, N):
    flag = True
    c = 0
    i = 0
    while flag:
        flag = False
        for j in range(N-1, i, -1):
            if A[j] < A[j-1]:
                A[j],  A[j-1] = A[j-1], A[j]
                c += 1
                flag = True
        i += 1

    return c


while True:

    N = int(raw_input())

    if N == 0:
        break
    
    A = [map(int, raw_input()) _ for i in range(N)]

    print bubble_sort(A, N)

### FIXED CODE ###

def bubble_sort(A, N):
    flag = True
    i, c = 0, 0
    while flag:
        flag = False
        for j in range(1, N-i):
              if A[j] < A[j-1]:
                  A[j],  A[j-1] = A[j-1], A[j]
                  flag = True
                  c += 1
        i += 1

    return c


while True:

    N = int(raw_input())

    if N == 0:
        break

    A = [int(raw_input()) for _ in xrange(N)]

    print bubble_sort(A, N)
n, b, r = map(int, input().split())
bl = ["b"]*b
rl = ["r"]*r
br = bl + rl
ball = []
sav = n
while n>0:
  ball += br
  n -= (b+r)
print(ball[:sav].count("b"))


### FIXED CODE ###

n, b, r = map(int, input().split())
div = n//(b+r)
base = b*div
zan = n%(b+r)
ama = min(zan, b)
print(base+ama)
D = int(input)
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
else:
    print('Christmas Eve Eve Eve')

### FIXED CODE ###

D = int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
else:
    print('Christmas Eve Eve Eve')
from copy import copy
import random
random.seed(1)
import math
import sys
input = sys.stdin.readline
D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for _ in range(D)]
last = [0]*26
ans = [0]*D
score = 0
for i in range(D):
    ps = [0]*26
    for j in range(26):
        pl = copy(last)
        pl[j] = i+1
        ps[j] += s[i][j]
        for k in range(26):
            ps[j] -= c[k]*(i+1-pl[k])
    idx = ps.index(max(ps))
    last[idx] = i+1
    ans[i] = idx+1
    score += max(ps)
for k in range(1,41001):
    na = copy(ans)
    x = random.randint(1,365)
    y = random.randint(1,365)
    na[x-1] = na[y-1]
    last = [0]*26
    ns = 0
    for i in range(D):
        last[na[i]-1] = i+1
        ns += s[i][na[i]-1]
        for j in range(26):
            ns -= c[j]*(i+1-last[j])
    if k%100 == 1:
        T = 200-(199*k/40000)
    p = pow(math.e,-abs(ns-score)/T)
    if ns > score or random.random() < p:
        ans = na
        score = ns
for a in ans:
    print(a)

### FIXED CODE ###

import random
for i in range(365):
  print(random.randint(1,26))
# -*- coding: utf-8 -*-
N = int(input())
A = map(int, input().split())

success =
for a in A:
    if a % 2  == 0 and (a % 3 == 0 or a % 5 ==0):
        print("DENIED")

print("APPROVED")

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())
A = map(int, input().split())

for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            continue
        print("DENIED")
        exit()
print("APPROVED")
class queue():
    def __init__(self):
        self.head = 0
        self.tail = 0
        self.MAX = 100000
        self.Q = [[0] for i in range(self.MAX-1)]

    def is_empty(self):
        return self.head == self.tail

    def is_full(self):
        return self.head == (self.tail + 1) % self.MAX

    def enqueue(self, x):
        if self.is_full():
            raise ValueError("エラー（オーバーフロー）")
        self.Q[self.tail] = x
        if self.tail + 1 == self.MAX:
            self.tail = 0
        else:
            self.tail += 1

    def dequeue(self):
        if self.is_empty():
            raise ValueError("エラー（アンダーフロー）")
        x = self.Q[self.head]
        if self.head + 1 == self.MAX:
            self.head = 0
        else:
            self.head += 1
        return x

n, q = input().split(" ")
n = int(n)
q = int(q)
q_name = queue()
q_val = queue()
for i in range(n):
    name, t = input().split(" ")
    t = long(t)
    q_name.enqueue(name)
    q_val.enqueue(t)

results = []
end_time = 0
while True:
    process_val = q_val.dequeue()
    process_name = q_name.dequeue()
    if process_val <= q:
        end_time += process_val
        results.append([process_name, end_time])
    else:
        end_time += q
        rest_val = process_val - q
        q_name.enqueue(process_name)
        q_val.enqueue(rest_val)
    
    if q_val.head == q_val.tail:
        break

for v in results:
    print("{} {}".format(v[0],v[1]))


### FIXED CODE ###

class queue():
    def __init__(self):
        self.head = 0
        self.tail = 0
        self.MAX = 100000
        self.Q = [[0] for i in range(self.MAX)]

    def is_empty(self):
        return self.head == self.tail

    def is_full(self):
        return self.head == (self.tail + 1) % self.MAX

    def enqueue(self, x):
        if self.is_full():
            raise ValueError("エラー（オーバーフロー）")
        self.Q[self.tail] = x
        if self.tail + 1 == self.MAX:
            self.tail = 0
        else:
            self.tail += 1

    def dequeue(self):
        if self.is_empty():
            raise ValueError("エラー（アンダーフロー）")
        x = self.Q[self.head]
        if self.head + 1 == self.MAX:
            self.head = 0
        else:
            self.head += 1
        return x

n, q = input().split(" ")
n = int(n)
q = int(q)
q_name = queue()
q_val = queue()
for i in range(n):
    name, t = input().split(" ")
    t = int(t)
    q_name.enqueue(name)
    q_val.enqueue(t)

results = []
end_time = 0
while True:
    process_val = q_val.dequeue()
    process_name = q_name.dequeue()
    if process_val <= q:
        end_time += process_val
        results.append([process_name, end_time])
    else:
        end_time += q
        rest_val = process_val - q
        q_name.enqueue(process_name)
        q_val.enqueue(rest_val)
    
    if q_val.head == q_val.tail:
        break

for v in results:
    print("{} {}".format(v[0],v[1]))
def main():
	# s = int(input())
	# s = str(input())
	a,b = map(int,input().split())

	from itertools import combinations

	if b == 0 or b == 1:
		print(len(combinations(a,2)))
	else:
		print(len(combinations(a,2)) + len(combinations(b,2)))


if __name__ == '__main__':
	main()

### FIXED CODE ###

def main():
	# s = int(input())
	# s = str(input())
	a,b = map(int,input().split())
	#1行R列
	# a = list(map(int,input().split()))
	#R行1列
	# l = [str(input()) for i in range(n)]
	#R行C列
	# qu = [list(map(str,input().split())) for x in range(q)]
	# print(' '.join(map(str,)))
	import math
	def combinations_count(n, r):
		return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

	if a <= 1 and b > 1:
		print(combinations_count(b,2))
	elif a <= 1 and b <= 1:
		print(0)
	elif a > 1 and b <= 1:
		print(combinations_count(a,2))
	else:
		print(combinations_count(a,2) + combinations_count(b,2))


if __name__ == '__main__':
	main()
C=int(input())
li=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
print(li[C+1])

### FIXED CODE ###

C=input()
li=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
count=li.index(C)
count=count+1
print(li[count])
H, W = map(int, raw_input().split())
S = [raw_input() for i in range(H)]
C = [[0] * W for i in range(H)]
for i in range(H):
    for j in range(W):
        for di in range(-1, 1):
            if i + di < 0 or H <= i + di:
                continue
            for dj in range(-1, 1):
                if j + dj < 0 or W <= j + dj:
                    continue
                C[i][j] += 1 if S[i][j] == "#" else -1
for i in range(H):
    print "".join(C[i])




### FIXED CODE ###

import sys
H, W = map(int, raw_input().split())
S = [raw_input() for i in range(H)]
C = [[0] * W for i in range(H)]
for i in range(H):
    for j in range(W):
        for di in range(-1, 2):
            if i + di < 0 or H <= i + di:
                continue
            for dj in range(-1, 2):
                if j + dj < 0 or W <= j + dj:
                    continue
                C[i][j] += 1 if S[i + di][j + dj] == "#" else 0
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            sys.stdout.write("#")
        else:
            sys.stdout.write(str(C[i][j]))
    print ""
n, k = map(int, input().split())
A = list(map(int, input().split()))

F = [0]*(k+1)
for x in range(k):
  for a in A:
    F[x] += x ^ a
print(max(F))

### FIXED CODE ###

n, k = map(int, input().split())
A = list(map(int, input().split()))

fmax = 0
for i in range(40, 0, -1):
  x = 2 ** (i - 1)
  f1 = 0
  f0 = 0
  for a in A:
    a_ = a & x
    f1 += x ^ a_
    f0 += a_
  #print(i, f0, f1)
  if f0 >= f1:
    fmax += f0
  else:
    if k >= x:
      fmax += f1
      k -= x
    else:
      fmax += f0
print(fmax)
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if 0 in A:
        print(0)
        return

    prod = 1
    for a in A:
        values *= a
        if prod >  1000000000000000000:
            print('-1')
            return
    print(prod)
main()

### FIXED CODE ###

def main ():
    N = int(input())
    A = list(map(int,input(). split ()))
    if 0 in A:
        print(0)
        return
    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return
    print(prod)
main ()
N,Q = map(int, input().split())
ANS = (N-2)**2
R,C=N,N
RLEN=[]
CLEN=[]
for i in range(Q):
    RC,num = map(int, input().split())
    if RC==1:
        if R>num:
            for j in range(R-num-1):
                RLEN.append(C)
            ANS-=C-2
            R=num
        else:
            if len(RLEN)>0:
                ANS-=RLEN[N-num-1]-2
            else:
                ANS-=R-2
    else:
        if C>num:
            for j in range(C-num-1):
                CLEN.append(R)
            ANS-=R-2
            C=num
        else:
            if len(CLEN)>0:
                ANS-=CLEN[N-num-1]-2
            else:
                ANS-=C-2

print(ANS)



### FIXED CODE ###

N,Q = map(int, input().split())
ANS = (N-2)**2
R,C=N,N
RLEN=[]
CLEN=[]
for i in range(Q):
    RC,num = map(int, input().split())
    if RC==1:
        if R>num:
            for j in range(R-num):
                RLEN.append(C)
            ANS-=C-2
            R=num
        else:
            if len(RLEN)>0:
                ANS-=RLEN[N-num-1]-2
            else:
                ANS-=R-2
    else:
        if C>num:
            for j in range(C-num):
                CLEN.append(R)
            ANS-=R-2
            C=num
        else:
            if len(CLEN)>0:
                ANS-=CLEN[N-num-1]-2
            else:
                ANS-=C-2

print(ANS)
c=[1]*100000
n=int(input())
for i in range(n):
    ai=int(input())-1
    c[ai]=1-c[ai]
    
icnt=0
for i in range(100000):
  if c[i]==0:
      icnt=icnt+1
      
print(icnt)
    

### FIXED CODE ###

dicc=dict()

n=int(input())
for i in range(n):
    ai=input()
    if ai in dicc:
        dicc[ai]=1-dicc[ai]
    else:
        dicc[ai]=1
        
icnt=0    
for i in dicc.values():
    icnt=icnt+i
      
print(icnt)