Harryxun/stf_run huggingface dataset:
r4 = range(4)
r13 = range(13)
cards = [[0 for i in r13] for j in r4]
while True:
    n = input()
    for i in range(n):
        s1, s2 = raw_input().split()
        s1 = 'SHCD'.index(s1)
        s2 = int(s2)-1
        print s1,s2
        cards[s1][s2] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0: print 'SHCD'[j],i+1

### FIXED CODE ###

r4 = range(4)
r13 = range(13)
cards = [[0 for i in r13] for j in r4]

n = input()
for i in range(n):
    s1, s2 = raw_input().split()
    s1 = 'SHCD'.index(s1)
    s2 = int(s2)-1
    cards[s1][s2] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0:
            print 'SHCD'[j],i+1
a, b = input()

if a < b:
 print "a < b"
if a == b:
 print "a == b"
if a > b:
 print "a > b"

### FIXED CODE ###

a, b = map(int, raw_input().split())
    
if a < b:
 print "a < b"
elif a > b:
 print "a > b"
else:
 print "a == b"
S = input()
if S == hi or S == hihi or S == hihihi or S == hihihihi or S == hihihihihi:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

S = input()
if S == "hi" or S == "hihi" or S == "hihihi" or S == "hihihihi" or S == "hihihihihi":
    print("Yes")
else:
    print("No")
N=int(input())
A=list(map(int,input().split()))
Q=int(input())

NumList=[0]*(10**5)

AllSum=sum(A)

for a in A:
  NumList[a]+=1

for i in range(Q):
  B,C=map(int,input().split())
  AllSum=AllSum + (C-B)*NumList[B]
  NumList[C]+=NumList[B]
  NumList[B]=0
  
  print(AllSum)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
Q=int(input())

NumList=[0]*(10**5+1)

AllSum=sum(A)

for a in A:
  NumList[a]+=1

for i in range(Q):
  B,C=map(int,input().split())
  AllSum=AllSum + (C-B)*NumList[B]
  NumList[C]+=NumList[B]
  NumList[B]=0
  
  print(AllSum)
int main(void){
    int S;
    int h, m, s;
 
    std::cin >> S;
 
    std::cout << S / 3600 << ":" << (S / 60) % 60 << ":" << (S % 3600) % 60 << std::endl;
    return 0;
}

### FIXED CODE ###

x = int(input())
 
h = x // 3600
m = x % 3600 // 60
s = x % 60
 
print(h,m,s,sep=':')
x = input()
print(x * x * x)

### FIXED CODE ###

x = int(input())
print(x * x * x)
N = int(input())
ans = -1
bef = -1
for i in range(N):
    now = int(data[input()])
    if now - bef > 1:
        ans = -1
        break
    elif now - bef == 1:
        ans += 1
        bef = now
    else:
        ans += now
        bef = now

print(str(ans))

### FIXED CODE ###

N = int(input())
ans = -1
bef = -1
for i in range(N):
    now = int(input())
    if now - bef > 1:
        ans = -1
        break
    elif now - bef == 1:
        ans += 1
        bef = now
    else:
        ans += now
        bef = now
 
print(str(ans))
n,a=map(int,input().split())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
if ans=100000000
  print('TLE')
else:
  print(ans)


### FIXED CODE ###

n,a=map(int,input().split())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
if ans==100000000:
  print('TLE')
else:
  print(ans)
X = int(input())
if x=3 or X=5 or x=7:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

x = int(input())
if x==3 or x==5 or x==7:
  print("YES")
else:
  print("NO")
n=6
a=[int(input()) for i in range(n)]
dero=np.zeros((25,2))
for i in range(5):
  for j in range (5):
    dero[i*5+j][0]=a[j]-a[i]
    dero[i*5+j][1]=a[5]
frag=0
for i in range(25):
  if dero[i][0]>dero[i][1]:
    frag=1
if frag==0:
  print("Yay!")
else:
    print(":(")

### FIXED CODE ###

import numpy as np
n=6
a=[int(input()) for i in range(n)]
dero=np.zeros((25,2))
for i in range(5):
  for j in range (5):
    dero[i*5+j][0]=a[j]-a[i]
    dero[i*5+j][1]=a[5]
frag=0
for i in range(25):
  if dero[i][0]>dero[i][1]:
    frag=1
if frag==0:
  print("Yay!")
else:
    print(":(")
n = int(input())
r = n // 4
for i in range(r+1):
  for j in range(r+1):
    if 4*i + 7*j == n:
      flag = True
      break
  if flag:
    print('Yes')
    break
  else:
    print('No')

### FIXED CODE ###

n = int(input())
r = n // 4
flag = False
for i in range(r+1):
  for j in range(r+1):
    if 4*i + 7*j == n:
      flag = True
      break
  if flag:
    print('Yes')
    break
  elif flag == False and i == r:
    print('No')
    break
import numpy as np

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

ans = 1
for a in A:
    ans *= a
    if ans > 10**18:
        ans = -1
        continue
    if a == 0:
        ans = 0
        break
print(ans)

### FIXED CODE ###

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

x = 10**18
ans = 1
for a in A:
    if ans != -1:
        ans *= a
    if ans > x:
        ans = -1
    if a == 0:
        ans = 0
        break
print(ans)
a = [int(i) for i in input().split()] 
sum = 0
if (a[0] == a[1]):
  if (a[0] == a[2]):
  	sum = 1
  else:
    sum = 2
elif (a[0] === a[2]):
  sum = 1
elif (a[1] === a[2]):
  sum = 1
else:
  sum = 0
  
print(sum)

### FIXED CODE ###

a = [int(i) for i in input().split()] 

if (a[0] == a[1]):
  if (a[1] == a[2]):
    sum = 1
  else:
    sum = 2
elif (a[0] == a[2]):
  sum = 2
elif (a[1] == a[2]):
  sum = 2
else:  
  sum = 3

print(sum)
R =input()
if R<1200:
  print('ABC')
elif R<2800:
  print('ARC')
else:
  print('AGC')

### FIXED CODE ###

R =int(input())
if R<1200:
  print('ABC')
elif R<2800:
  print('ARC')
else:
  print('AGC')
input_H1 = input()
input_H2 = input()

H1 = int(input_H1)
H2 = int(input_H2)

print((H1-1)*(H2-1))


### FIXED CODE ###

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

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

x1, y1, x2, y2 = map(int, input().split())
print('{:.5f}'.format(math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))))

### FIXED CODE ###

import math

x1, y1, x2, y2 = map(float, input().split())
print('{:.5f}'.format(math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))))
n = int(input())
L = list(map(int, input().split()))
cnt = 1
state = None
i = 1
while i < n:
    if state is None:
        if L[i] > L[i - 1]:
            state = 'up'
        elif L[i] < L[i - 1]:
            state = 'down'
        i += 1
    else:
        if state == 'up':
            while L[i] >= L[i - 1]:
                i += 1
                if i == n - 1:
                    print(cnt)
                    exit()
            cnt += 1
            i += 1
            state = None
        else:
            while L[i] <= L[i - 1]:
                i += 1
                if i == n - 1:
                    print(cnt)
                    exit()
            cnt += 1
            i += 1
            state = None
print(cnt)

### FIXED CODE ###

n = int(input())
L = list(map(int, input().split()))
cnt = 1
state = None
i = 1
while i < n:
    if state is None:
        if L[i] > L[i - 1]:
            state = 'up'
        elif L[i] < L[i - 1]:
            state = 'down'
        i += 1
    else:
        if state == 'up':
            while L[i] >= L[i - 1]:
                i += 1
                if i >= n - 1:
                    print(cnt)
                    exit()
            cnt += 1
            i += 1
            state = None
        else:
            while L[i] <= L[i - 1]:
                i += 1
                if i >= n - 1:
                    print(cnt)
                    exit()
            cnt += 1
            i += 1
            state = None
print(cnt)
import math
x = int(input())
c = x * 2 * math.pi
a = x ** 2 * math.pi
print('{:.6f} {:.6f}'.format(c, a))

### FIXED CODE ###

from math import pi

r = float(input())
area = lambda x: r * r * pi
length = lambda x: r * 2 * pi

print("{} {}".format(area(r), length(r)))
import numpy as np
L = int(input())
R = int(input())

ans = 2019*2019

if(R-L >=2019):
    print(0)
else:
    for i in range(L,R-1):
        for j in range(i+1,R):
            ans = np.minimum(ans,(i*j)%2019)
            if(ans == 0):
                print(0)
                exit()
    print(ans)

### FIXED CODE ###

import numpy as np
S = input().split() 
L = int(S[0])
R = int(S[1])
ans = 2019*2019
if(R-L >=2019):
    print(0)
else:
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans = np.minimum(ans,(i*j)%2019)
            if(ans == 0):
                print(0)
                exit()
    print(ans)
import math
a, b, c, d = map(int, input().split())

ans = b - (b // c + b//d - b//(c*d // math.gcd(c, d))) - ( a - 1  - ((a-1) // c + (a-1)//d - (a-1)//(c * d //math.gcd(c, d))))  

print(ans)

### FIXED CODE ###

import fractions
a, b, c, d = map(int, input().split())

ans = b - (b // c + b//d - b//(c*d // fractions.gcd(c, d))) - ( a - 1  - ((a-1) // c + (a-1)//d - (a-1)//(c * d //fractions.gcd(c, d))))  

print(ans)
a, b = map(int, input().split())
h = (b-a)(b-a+1)//2
print(h-b)

### FIXED CODE ###

a, b = map(int, input().split())
h = (b-a)*(b-a+1)//2
print(h-b)
N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[-1]
A = [ min(B[i],B[i+1] for i in range (N-2) ]
C = sum(k + A)
print(C)


### FIXED CODE ###

N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[N-2]
for i in range(1, N-1):
    if B[i] < B[i-1]:
        k += B[i]
    else:
        k += B[i-1]
print(k)
s = input()
t = input()
n = len(s)
for i in range(n):
  if s[i] != t[i]:
    print("No")
    return
print("Yes")

### FIXED CODE ###

import sys
s = input()
t = input()
n = len(s)
for i in range(n):
  if s[i] != t[i]:
    print("No")
    sys.exit()
print("Yes")
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
suf = 0
for i in range (n):
  suf += b[i]
  if a[i]  + 1 == a[i+1]:
    suf += c[i]
print(suf)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
suf = 0
for i in range (n):
  suf += b[i]
  if i >= 1 and a[i - 1]  + 1 == a[i]:
    suf += c[a[i - 1] - 1]
print(suf)
a = int(input())

b = []

for i in a:
    b.append(input())

res = 0

num = a.pop(0) * 2

for i in range(b):
    if (b[i] == 'BTC'):
        c = int(a[i-1]) * 380000
        res += c
    elif (b[i] == 'JPY'):
        res += int(b[i-1])
    else:
        pass

print(res) 

### FIXED CODE ###

a = int(input())

b = []

for i in range(a):
    b.append(input().split())

res = 0

for i in b:
    if (i[1] == 'BTC'):
        res += float(i[0])*380000
    else:
        res += int(i[0])

print(res)
A,B,C = map(int,input().split())

ans = A+B+C
if ans>=22:
	print(bust)
elif ans <= 21:
	print(win)

### FIXED CODE ###

A,B,C = map(int,input().split())
ans = A + B + C

if ans >= 22:
	print("bust")
else:
	print("win")
N, x = map(int, input().split())
a = [int(j) for j in input().split()]
count = 0
for i in range(N-1):
      dif = a[i] + a[i+1] - x
      if dif > x:
            if a[i+1] >x:
                  count += dif
                  a[i+1] -= dif
            else:
                  count += dif
                  a[i] -= dif - a[i + 1]
                  a[i + 1] = 0
print(count)


### FIXED CODE ###

a, x, c = input().split()
print("A"+x[0]+"C")
#include <iostream>
#include <string>
using namespace std;

int main(){
    string input_str;

    cin >> input_str;

    for (int i=0; i < input_str.size(); i++){
        if (input_str[i] == ',') input_str[i] = ' ';
    }

    cout << input_str << endl;

    return 0;
}


### FIXED CODE ###

def main():
    s = input()
    print(s.replace(",", " "))

if __name__ == "__main__":
    main()
def action(A, N):
  B = [0] * (N + 1)
  for i, bright in enumerate(A):
    s = max(0, i - bright)
    B[s] += 1
    e = min(N, i + bright)
    B[e + 1] -= 1
  
  for i in range(N):
    B[i + 1] += B[i]
  return B[:-1]

def main():
  N, K = map(int, input().split())
  A = list(map(int, input().split()))

  for i in range(K):
    A = action(A, N)
    if A[0] == N & all(A):
      break
      
  print(*A, sep=" ")

if __name__ == '__main__':
  main()

### FIXED CODE ###

def action(A, N):
  B = [0] * N
  for i, bright in enumerate(A):
    s = max(0, i - bright)
    B[s] += 1
    e = min(N, i + bright)
    if e < N - 1:
      B[e + 1] -= 1
  
  for i in range(N - 1):
    B[i + 1] += B[i]
  return B

def main():
  N, K = map(int, input().split())
  A = list(map(int, input().split()))

  for i in range(K):
    A = action(A, N)
    if (A[0] == N) & all(A):
      break
      
  print(*A, sep=" ")

if __name__ == '__main__':
  main()
# import sys
# sys.setrecursionlimit(10**6)

n = int(input())
h = list(map(int, input().split()))
# dp = [[None] * 10**6 for _ in range(n)]
dp = [None] * (n+1)

# Return the smallest cost to reach the idx
def solve(idx):
    if dp[idx] is not None:
        return dp[idx]

    if idx == 1:
        dp[idx] = abs(h[idx] - h[idx - 1])
    elif idx == 0:
        dp[idx] = 0
    else:
        # jump from idx - 1
        c1 = solve(idx - 1) + abs(h[idx] - h[idx - 1])

        # jump from idx - 2
        c2 = solve(idx - 2) + abs(h[idx] - h[idx - 2])

        dp[idx] = min(c1, c2)

    return dp[idx]

ans = solve(n-1)

print(ans)

### FIXED CODE ###

n = int(input())
hs = list(map(int, input().split()))
dp = [0]*n

# cost1 = dp[i-1] + abs(dp[i-1]-dp[i])
# cost2 = dp[i-2] + abs(dp[i-2]-dp[i])
# dp[i] = min(cost1, cost2)

#for i in reversed(range(n)):
for i in range(n):
    if i == 0:
        dp[0] = 0
    elif i == 1:
        dp[1] = abs(hs[0]-hs[1])
    else:
        cost1 = dp[i-1] + abs(hs[i-1]-hs[i])
        cost2 = dp[i-2] + abs(hs[i-2]-hs[i])
        dp[i] = min(cost1, cost2)

print(dp[n-1])
a,b,c=map(int,input().split())
if a < b < c:
    print("Yes")
Print ("No")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a < b < c:
    print("Yes")
else:
  print("No")
from collections import deque

N, M = map(int,input().split())
ac = [0] * M
pena = [0] * M

for a in range(M):
    p,s = input().split()
    
    p = int(p) - 1

    if ac[p]:
        continue
    if s == 'AC':
        ac[p] = 1
    else:
        pena[p] += 1

AC = 0
PENA = 0

for a in range(N):
    AC += ac[a]
    if ac[a]:
        PENA += pena[a]

print(AC,PENA)

### FIXED CODE ###

from collections import deque

N, M = map(int,input().split())
ac = [0] * N
pena = [0] * N

for a in range(M):
    p,s = input().split()
    
    p = int(p) - 1

    if ac[p]:
        continue
    if s == 'AC':
        ac[p] = 1
    else:
        pena[p] += 1

AC = 0
PENA = 0

for a in range(N):
    AC += ac[a]
    if ac[a]:
        PENA += pena[a]

print(AC,PENA)
n = input().split()

if int(n) % 4 == 0:
	print("YEES")
else:
	print("NO")

### FIXED CODE ###

n = int(input().replace(' ', ''))
if n % 4 == 0:
  print("YES")
else:
  print("NO")
S, T = list(input().split())
s = len(S)
t = len(T)
l1 = [] 
l2 = []
n = 0
for i in range(n, s-t+1): 
    ss = S[n:t + n]
    n += 1
    m = 0
    for x in ss:       
        if x == T[m]:
            l1.append(1)
            m +=1
        else:
            l1.append(0)
            m +=1   
    l2.append(sum(l1))
    l1 = []
print(t - max(l2))

### FIXED CODE ###

S = input()
T = input()
s = len(S)
t = len(T)
l1 = [] 
l2 = []
n = 0
for i in range(n, s-t+1): 
    ss = S[n:t + n]
    n += 1
    m = 0
    for x in ss:       
        if x == T[m]:
            l1.append(1)
            m +=1
        elif x != T[m]:
            l1.append(0)
            m +=1   
    l2.append(sum(l1))
    l1 = [ ]
print(t - max(l2))
import sys
S = list(input())
S.insert(0,"X")

for i in range(1,len(S)-1,2):
  if S[i] == "L":
    print("No")
    sys.exit()
for j in range(2,len(S)-1,2):
  if S[i] == "R":
    print("No")
    sys.exit()
print"Yes")
    

### FIXED CODE ###

import sys
S = list(input())
S.insert(0,"X")

#文字列の奇数番目をチェック
for i in range(1,len(S),2):
  if S[i] == "L":
    print("No")
    sys.exit()
#文字列の偶数番目をチェック
for j in range(2,len(S),2):
  if S[j] == "R":
    print("No")
    sys.exit()
print("Yes")
import itertools
N=int(input())
l=[]
for i in range(N):
  x,y,h=map(int,input().split())
  l.append([x,y,h])
s=set(itertools.product(range(0,101),repeat=2))
for A,B in itertools.combinations(range(N),2):
  if len(s)==1:
    break
  t=set()
  if l[A][2]>l[B][2]:
    for X,Y in s:
      if abs(X-l[A][0])+abs(Y-l[A][1])<abs(X-l[B][0])+abs(Y-l[B][1]):
        t.add((X,Y))
  elif l[A][2]<l[B][2]:
    for X,Y in s:
      if abs(X-l[A][0])+abs(Y-l[A][1])>abs(X-l[B][0])+abs(Y-l[B][1]):
        t.add((X,Y))
  elif l[A][2]!=0:
    for X,Y in s:
      if abs(X-l[A][0])+abs(Y-l[A][1])==abs(X-l[B][0])+abs(Y-l[B][1]):
        t.add((X,Y))
  else:
    t=s.copy()
    if (l[A][0],l[A][1]) in t:
      t.remove((l[A][0],l[A][1]))
    if (l[B][0],l[B][1]) in t:
      t.remove((l[B][0],l[B][1]))    

  s=t.copy()
a,b=s[0][0],s[0][1]
h=abs(a-l[0][0])+abs(b-l[0][1])+l[0][2]
print(a,b,h)

### FIXED CODE ###

import itertools
N=int(input())
l=[]
#l:調査情報のリスト
for i in range(N):
  x,y,h=map(int,input().split())
  l.append([x,y,h])
M=max(item[2] for item in l)#高さの最大値(暫定)
s=list(itertools.product(range(0,101),repeat=2))
#s:中心座標の候補リスト
for A,B in itertools.combinations(range(N),2):
  #調査情報の全ての2つ組を用いて絞り込む
  if len(s)==1:
    break
  t=[]
  #t:新たな中心座標の候補リスト
  if l[A][2]<l[B][2]:
    A,B=B,A
  if l[A][2]>l[B][2]:
    #2地点の高さが異なる場合
    if l[B][2]==0:
      #B地点の高さが0ならB地点は中心から[Aの高さ]以上離れている
      gap=l[A][2]-l[B][2]
      for X,Y in s:
        if abs(X-l[A][0])+abs(Y-l[A][1])+gap<=abs(X-l[B][0])+abs(Y-l[B][1]):
          t.append((X,Y))
    else:
      #B地点の高さが0でなければA地点は中心から[Aの高さ-Bの高さ]だけ離れている
      gap=l[A][2]-l[B][2]
      for X,Y in s:
        if abs(X-l[A][0])+abs(Y-l[A][1])+gap==abs(X-l[B][0])+abs(Y-l[B][1]):
          t.append((X,Y))
  
  elif l[A][2]!=0:
    #2地点の高さが等しく0ではない場合
    #2地点からM-[Aの高さ]以上離れた地点のみ残す
    for X,Y in s:
      MM=max(1,M-l[A][2])
      if abs(X-l[A][0])+abs(Y-l[A][1])==abs(X-l[B][0])+abs(Y-l[B][1]) and abs(X-l[A][0])+abs(Y-l[A][1])>=MM and abs(X-l[B][0])+abs(Y-l[B][1])>=MM:
        t.append((X,Y))
  else:
    #2地点の高さが等しく0の場合
    #2地点からM以上離れた地点のみ残す
    for X,Y in s:
      if abs(X-l[A][0])+abs(Y-l[A][1])>=M and abs(X-l[B][0])+abs(Y-l[B][1])>=M:
        t.append((X,Y))
  s=t[:]
#sの要素は唯一だと思いたい
a,b=s[0][0],s[0][1]
i=0
while l[i][2]==0:
  i+=1

h=abs(a-l[i][0])+abs(b-l[i][1])+l[i][2]
print(a,b,h)
import bisect
from collections import deque
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()

d = deque([])
for i in range(N):
  n = bisect.bisect_right(C, B[N-1-i])
  if len(d) == 0:
    d.appendleft(N-n)
  else:
    d.appendleft(N-n+d[0])
  
ans = 0
for i in range(N):
  n = bisect.bisect_right(B, A[i])
  ans += d[n]
print(ans)

### FIXED CODE ###

import bisect
from collections import deque
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()

d = deque([])
for i in range(N):
  n = bisect.bisect_right(C, B[N-1-i])
  if len(d) == 0:
    d.appendleft(N-n)
  else:
    d.appendleft(N-n+d[0])
  
ans = 0
for i in range(N):
  m = bisect.bisect_right(B, A[i])
  if m < N:
    ans += d[m]
print(ans)
n, x = map(int, input().split())
l = list(map(int, input().split()))

cnt = 0
d = 0

while(x >= d):
  d += l[cnt]
  cnt += 1

print(cnt)

### FIXED CODE ###

n, x = map(int, input().split())
l = list(map(int, input().split()))

cnt = 1
d = 0

while(True):
  if cnt - 1 == n:
    break
  d += l[cnt - 1]
  if d > x:
    break
  cnt += 1

print(cnt)
dish_list = [int(input()) for _ in range(5)]
last_num_list = [int(str(dish_i)[-1]) for dish_i in dish_list]
target_index =min(list(filter(lambda x: x>0, last_num_list)))

last_num_min_index = last_num_list.index(target_index)
ceiling_dish_list = [-10* (-i//10) for i in dish_list]

print(sum(ceiling_dish_list) - ceiling_dish_list[last_num_min_index] + dish_list[last_num_min_index])

### FIXED CODE ###

dish_list = [int(input()) for _ in range(5)]
last_num_list = [int(str(dish_i)[-1]) for dish_i in dish_list]

if sum(last_num_list) % 10 == 0:
  print(sum(dish_list))
else:  
  target_index = min(list(filter(lambda x: x>0, last_num_list)))

  last_num_min_index = last_num_list.index(target_index)
  ceiling_dish_list = [-10* (-i//10) for i in dish_list]

  print(sum(ceiling_dish_list) - ceiling_dish_list[last_num_min_index] + dish_list[last_num_min_index])
import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

N,M = map(int,input().split())
l = [[0 for i in range(N)] for j in range(N)]
for i in range(M):
    A,B = map(int,input().split())
    l[A-1][B-1] = 1
    l[B-1][A-1] = 1
a = np.array(l)
n, labels = connected_components(a)
if n == 1:
    print('Yes')
    s = [0]
    t = [i for i in range(1,N)]
    ans = [0]*N
    x = 1
    #print(l)
    while True:
        S = s.copy()
        for i in S:
            for j in t:
                if l[i][j] == 1 :
                    s.append(j)
                    t.remove(j)
                    ans[j] = i+1
                    #print(i,j)
        if t == []:
            break
    for i in range(1,N):
        print(ans[i])
else:
    print('No')


### FIXED CODE ###

n,m = map(int,input().split())

import heapq

def dijkstra(s):
    d = 1
    hq = [(0, s)]
    heapq.heapify(hq) # リストを優先度付きキューに変換
    cost = [float('inf')] * n # 行ったことのないところはinf
    cost[s] = 0 # 開始地点は0
    while hq:
        c, v = heapq.heappop(hq)
        if c > cost[v]: # コストが現在のコストよりも高ければスルー
            continue
        for u in e[v]:
            tmp = 1 + cost[v]
            if tmp < cost[u]:
                cost[u] = tmp
                heapq.heappush(hq, (tmp, u))
    return cost

e = [[] for _ in range(n)]
for _ in range(m):
    a,b = map(int,input().split())
    a,b = a-1, b-1
    e[a].append(b)
    e[b].append(a) # 有向グラフでは削除

d = dijkstra(0)
# print(d)
# print(e)
ans = [0]*(n)
for i in range(1,n):
    for j in e[i]:
        # print(i,j)
        if d[j] == d[i] - 1:
            ans[i] = j + 1
            continue

print("Yes")
print(*ans[1:], sep="\n")
A_1, A_2, A_3 = int(input()).split()

Score = A_1+A_2+A_3
if Score <= 21:
    print(win)
else:
    print(bust)

### FIXED CODE ###

A_1, A_2, A_3 = input().split()

Score = int(A_1)+int(A_2)+int(A_3)
if Score <= 21:
    print("win")
else:
    print("bust")
text = input()

flg = 0
for i in range(len(text)):
	if i%2 == 0:
		if text[i:i+1] != 'R' and text[i:i+1] and 'U' and text[i:i+1] != 'D':
			flg = 1
	else:
		if  text[i:i+1] != 'U' and text[i:i+1] and 'U' and text[i:i+1] != 'D':
			flg = 1
if flg == 1:
	print('No')
else:
	pring('Yes')

### FIXED CODE ###

text = input()
 
flg = 0
for i in range(len(text)):
	if i%2 == 0:
		if text[i:i+1] != 'R' and text[i:i+1] != 'U' and text[i:i+1] != 'D':
			flg = 1
	else:
		if  text[i:i+1] != 'L' and text[i:i+1] != 'U' and text[i:i+1] != 'D':
			flg = 1
if flg == 1:
	print('No')
else:
	print('Yes')
n,m = map(int,input().split())
a_n = list(map(int,input().split()))
b_and_c = []
for i in range(m):
    b_and_c.append(list(map(int,input().split())))

a_n.sort()

b_and_c.sort(key = lambda x : x[1], reverse = True)
index = 0
for i in range(m):
    if a_n[index] >= b_and_c[i][1] or index >= n:
        break
    for j in range(index, n):
        if a_n[j] < b_and_c[i][1]:
            for k in range(j, min(j + b_and_c[i][0], n)):
                if a_n[k] < b_and_c[i][1]:
                    a_n[k] = b_and_c[i][1]
                else:
                    break
            index = k + 1
            break

print(sum(a_n))

### FIXED CODE ###

n,m = map(int,input().split())
a_n = list(map(int,input().split()))
b_and_c = []
for i in range(m):
    b_and_c.append(list(map(int,input().split())))

a_n.sort()

b_and_c.sort(key = lambda x : x[1], reverse = True)
index = 0
for i in range(m):
    if index >= n:
        break
    elif a_n[index] >= b_and_c[i][1]:
        break
    for j in range(index, n):
        if a_n[j] < b_and_c[i][1]:
            for k in range(j, min(j + b_and_c[i][0], n)):
                if a_n[k] < b_and_c[i][1]:
                    a_n[k] = b_and_c[i][1]
                else:
                    break
            index = k + 1
            break

print(sum(a_n))
n = int(input())
ans = 1
for i in range(0, n):
	t = int(input())
	ans *= t
if ans > int(1e18):
	print(-1)
else:
	print(ans)

### 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 > int(1e18):
			print(-1)
			return

	print(prod)

main()
a, b = map(int, input())
ans = a - 2 * b
if ans < 0:
  ans = 0
print(ans)

### FIXED CODE ###

a, b = map(int, input().split())
ans = a - 2 * b
if ans < 0:
  ans = 0
print(ans)