Harryxun/stf_run huggingface dataset:
import sys
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

x,y= (int(_) for _ in input().split()) 
if (x+y)%3!=0:
    print(0)
    sys.exit()
else:
    n=(x+y)/3
    n=int(n)
    if x<n or y<n:
         print(0)
         sys.exit()
    else:
        x=x-n
        y=y-n
        ans=int(combinations_count(x+y, min[x,y]))
        print(ans%1000000007)

### FIXED CODE ###

import sys
import math
from operator import mul
from functools import reduce
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 
N = 10**6
g1 = [1, 1] 
g2 = [1, 1] 
inverse = [0, 1] 

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

x,y= (int(_) for _ in input().split()) 
if (x+y)%3!=0:
    print(0)
    sys.exit()
else:
    n=(x+y)/3
    n=int(n)
    if x<n or y<n:
         print(0)
         sys.exit()
    else:
        x=x-n
        y=y-n
        ans=int(cmb(x+y, x,mod))
        print(ans%1000000007)
def spaceinput():
    return list(map(int,input().split(" ")))


N=int(input())
a=spaceinput()


sa=sorted(a,reverse=True)
x=[]
i=0
while True:
    if i>=len(sa)-1:
        break
    ssa=sa[i]
    if sa[i]==sa[i+1]:
        x.append(ssa)
        i+=2
        if len(x)==2:
            break
        continueß

    i+=1


x.extend([0,0])

print(x[0]*x[1])

### FIXED CODE ###

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


N=int(input())
a=spaceinput()


sa=sorted(a,reverse=True)
x=[]
i=0
while True:
    if i>=len(sa)-1:
        break
    ssa=sa[i]
    if sa[i]==sa[i+1]:
        x.append(ssa)
        i+=2
        if len(x)==2:
            break
        continue

    else:
        i+=1


x.extend([0,0])

print(x[0]*x[1])
n,m=map(int,input().split())
S=[]
for m in range(m):
  s=list(map(int,input().split()))
  S.sppend(s[1:])
p=list(map(int,input().split()))

ans=0
for i in range(1<<n):
  for k in range(m):
    sw=0
    for j in range(n):
      if (i>>j)&1==0 and j+1 in s[k]:
        sw+=1
    if se%2!=p[k]:
      break
  else:
    ans+=1
print(ans)



### FIXED CODE ###

N,M=map(int,input().split())
s=[list(map(int,input().split()))[1:] for m in range(M)]
p=list(map(int,input().split()))
count=0
for i in range(1<<N):
    for m in range(M):
        switch=0
        for j in range(N):
            if (i>>j)&1 and j+1 in s[m]:
                switch+=1
        if switch%2!=p[m]:
            break
    else:
        count+=1
print(count)
a,b=[int(x) for x in input().split()]

if a<b:
print('a<b')

elif a>b:
print('a>b')

elif a==b:
print('a==b')


### FIXED CODE ###

a,b=[int(x) for x in input().split()]
op = '>' if a>b else '<' if a<b else '=='
print('a',op,'b')
h,w = map(int,input().split())
l = list(list(input()) for i in range(h))
for i in l:
  if i.count('.') ==w:
    i.clear()
    l.remove([])
t = len(l)
for i in range(w):
  if all (l[q][i]=="." for q in range(t)):
    for q in range(t):
      l[q][i] =""
for z in l:
  z.remove("")
for i in l:
  print("".join(i))
  

### FIXED CODE ###

h,w = map(int,input().split())
l = list(list(input()) for i in range(h))
for i in l:
  if i.count('.') ==w:
    i.clear()
l= [i for i in l if i!=[]]
#print(l)
t = len(l)
for i in range(w):
  if all (l[q][i]=="." for q in range(t)):
    for q in range(t):
      l[q][i] =""
if "" in l:
  for z in l:
    z.remove("")
for m in l:
  print("".join(m))
print(min(int(input(), int(input()))) + min(int(input(), int(input()))))

### FIXED CODE ###

print(min(int(input()), int(input())) + min(int(input()), int(input())))
MOD = 998244353
def pow(n,k,m):#n^k mod m
    ans = 1
    while k>0:
        if(k & 1):ans = (ans*n) % m
        n = (n*n)%m
        k >>= 1
    return ans

n = int(input())
a =[int(input()) for i in range(n)]
s = sum(a)
dp1 = [0 for i in range(s+1)] #dp1[x]:Bの和=xとなるような塗り方の総数

dp1[0] = 1

for i in range a:
    dpp1 = [0 for i in range(s+1)]
    for j in range(s+1):
        if j+i <= s:dpp1[j+i] = (dp1[j]+dpp1[j+i]) % MOD
        dpp1[j] = (dp1[j]*2 + dpp1[j]) % MOD
    dp1 = dpp1[:]

if s % 2 == 1:
    ans1 = sum(dp1[(s//2) + 1:]) % MOD
    print((pow(3,n,MOD)-ans1*3) % MOD)
    exit()

ans1 = sum(dp1[(s//2):]) % MOD

dp2 = [0 for i in range(s+1)]

dp2[0] = 1

for i in a:
    dpp2 = [0 for i in range(s+1)]
    for j in range(s+1):
        if j+i <= s:dpp2[j+i] = (dp2[j]+dpp2[j+i]) % MOD
        dpp2[j] = (dp2[j] + dpp2[j]) % MOD
    dp2 = dpp2[:]

print((pow(3,n,MOD)-(ans1*3 - dp2[s//2]*3)) % MOD)

### FIXED CODE ###

MOD = 998244353
def pow(n,k,m):#n^k mod m
    ans = 1
    while k>0:
        if(k & 1):ans = (ans*n) % m
        n = (n*n)%m
        k >>= 1
    return ans

n = int(input())
a =[int(input()) for i in range(n)]
s = sum(a)
dp1 = [0 for i in range(s+1)] #dp1[x]:Bの和=xとなるような塗り方の総数

dp1[0] = 1

for i in  a:
    dpp1 = [0 for i in range(s+1)]
    for j in range(s+1):
        if j+i <= s:dpp1[j+i] = (dp1[j]+dpp1[j+i]) % MOD
        dpp1[j] = (dp1[j]*2 + dpp1[j]) % MOD
    dp1 = dpp1[:]

if s % 2 == 1:
    ans1 = sum(dp1[(s//2) + 1:]) % MOD
    print((pow(3,n,MOD)-ans1*3) % MOD)
    exit()

ans1 = sum(dp1[(s//2):]) % MOD

dp2 = [0 for i in range(s+1)]

dp2[0] = 1

for i in a:
    dpp2 = [0 for i in range(s+1)]
    for j in range(s+1):
        if j+i <= s:dpp2[j+i] = (dp2[j]+dpp2[j+i]) % MOD
        dpp2[j] = (dp2[j] + dpp2[j]) % MOD
    dp2 = dpp2[:]

print((pow(3,n,MOD)-(ans1*3 - dp2[s//2]*3)) % MOD)
a,b=map(int,raw_input().split())

def val():
	if a==1 or (a>b and b!=1):
		return "ALICE"
	else:
		return "BOB"
print (val())	

### FIXED CODE ###

a,b=map(int,raw_input().split())
if a==1:
	a=14
if b==1:
	b=14
 
def val():

	if(a>b):
		return "Alice"
	elif b>a:
		return "Bob"
	return "Draw"
print (val())
MOD=1000000007
def modpow(a,n,mod):
    res=1
    a=a%mod
    while(n>0):
        if(n&1):
            res=res*a%mod
        a=a*a%mod
        n>>=1
    return res

N=int(input())
A=list(map(int,input().split()))
cnt=[0]*10001
for i in range(N):
    cnt[A[i]]+=1
if(N%2==1):
    if(cnt[0]!=1):
        print(0)
        exit()
    for i in range(2,N,2):
        if(cnt[i]!=2):
            print(0)
            exit()
elif(N%2==0):
    for i in range(1,N,2):
        if(cnt[i]!=2):
            print(0)
            exit()
print(modpow(2,N//2,MOD))

### FIXED CODE ###

MOD=1000000007
def modpow(a,n,mod):
    res=1
    a=a%mod
    while(n>0):
        if(n&1):
            res=res*a%mod
        a=a*a%mod
        n>>=1
    return res

N=int(input())
A=list(map(int,input().split()))
cnt=[0]*100001
for i in range(N):
    cnt[A[i]]+=1
if(N%2==1):
    if(cnt[0]!=1):
        print(0)
        exit()
    for i in range(2,N,2):
        if(cnt[i]!=2):
            print(0)
            exit()
elif(N%2==0):
    for i in range(1,N,2):
        if(cnt[i]!=2):
            print(0)
            exit()
print(modpow(2,N//2,MOD))
import sys
args = sys.argv
a=int(args[1])
b=int(args[2])
print (a*b,a*2+b*2)

### FIXED CODE ###

s = input().split()
a=int(s[0])
b=int(s[1])
print(a*b,a*2+b*2)
a,b = map(int,input().sep())

men = a*b
hen =(a+b)*2

print(men,hen)

### FIXED CODE ###

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

men = a*b
hen = 2*(a+b)

print(men,hen,sep=" ")
h,w=map(int,input().split())
a=[list(map(int,input().split())) for i in range(h)]
b=[list(map(int,input().split())) for i in range(h)]
d=[[0 for i in range(w)] for j in range(h)]
for i in range(h):
    for j in range(w):
        d[i][j] = abs(a[i][j]-b[i][j])
dp=[[[] for j in range(w)] for k in range(h)]
dp[0][0].append(d[0][0])
for i in range(h):
    for j in range(w):
        for x in dp[i][j]:
            if i+1<h:
                dp[i+1][j].append(dis+d[i+1][j])
                dp[i+1][j].append(abs(dis-d[i+1][j]))
            if j+1<w:
                dp[i][j+1].append(dis+d[i][j+1])
                dp[i][j+1].append(abs(dis-d[i][j+1]))
m=10000000
for dis in dp[-1][-1]:
    m=min(m,dis)
print(m)

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
h,w=map(int,input().split())
a=[list(map(int,input().split())) for i in range(h)]
b=[list(map(int,input().split())) for i in range(h)]
d=[[0 for i in range(w)] for j in range(h)]
maxd=1
for i in range(h):
    for j in range(w):
        d[i][j] = abs(a[i][j]-b[i][j])
        maxd=max(maxd,d[i][j])
dp=[[0 for j in range(w)] for k in range(h)]
c=20000
dp[0][0] |= 1 << c+d[0][0]
for i in range(h):
    for j in range(w):
        if i+1<h:
            dp[i+1][j] |= dp[i][j] << d[i+1][j]
            dp[i+1][j] |= dp[i][j] >> d[i+1][j]
        if j+1<w:
            dp[i][j+1] |= dp[i][j] << d[i][j+1]
            dp[i][j+1] |= dp[i][j] >> d[i][j+1]
m=1000000
cnt = 0
for x in bin(dp[h-1][w-1])[2:][::-1]:
    if x=='1':
        m=min(m,abs(cnt-c))
    cnt+=1
print(m)
n,m,k = map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
A,B = [0],[0]
 
for i in range(n):
  A.append(a[i] + A[i])
for i in range(m):
  B.append(b[i] + B[i])
 
num,x = 0,m-1
A.pop(0)
B.pop(0)
 
for i in range(len(a)+1):
  if A[i] > k:
    break
  while A[i] + B[x] > k:
    x -= 1
  num = max(num, i + x + 2)
  
print(num)
n,m,k = map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
A,B = [0],[0]
 
for i in range(n):
  A.append(a[i] + A[i])
for i in range(m):
  B.append(b[i] + B[i])
 
num,x = 0,m-1
A.pop(0)
B.pop(0)
 
for i in range(len(A)-1):
  if A[i] > k:
    break
  while A[i] + B[x] > k:
    x -= 1
  num = max(num, i + x + 2)
  
print(num)


### FIXED CODE ###

n,m,k = map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
A,B = [0],[0]

for i in range(n):
  A.append(a[i] + A[i])
for i in range(m):
  B.append(b[i] + B[i])

num,x = 0,m

for i in range(n+1):
  if A[i] > k:
    break
  while A[i] + B[x] > k:
    x -= 1
  num = max(num, i + x)
  
print(num)
import copy

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

def gcd_list(numbers):
    g = numbers[0]
    for m in numbers:
        g = gcd(g, m)
    return g

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

gcds = list()
for a in A:
    B = copy.deepcopy(A)
    B.remove(a)
    g = gcd_list(B)
    gcds.append(g)
print(max(gcds))

### FIXED CODE ###

input_str = input().split(" ")
input_int = list(map(int, input_str))
A = input_int[0]
B = input_int[1]
T = input_int[2]

bis_sum = 0
start = 0
end = A
while True:
    if start < T+0.5 and end > T+0.5:
        break
    start += A
    end += A
    bis_sum += B

print(bis_sum)
import sys


def count(i, c):
    counter[i] = c+rc[i]
    for e in es[i]:
        if counter[e] == 0:
            count(e, counter[i])


if __name__ == "__main__":
    sys.setrecursionlimit(2*(10**5))
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    es = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a-1].append(b-1)
    counter = [0]*N
    rc = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        rc[p-1] += x
    count(0, 0)
    print(*counter)


### FIXED CODE ###

import sys


def count(i, r, value):
    value += rc[i]
    counter[i] = value
    for e in es[i]:
        if e != r:
            count(e, i, value)


if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    es = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a-1].append(b-1)
        es[b-1].append(a-1)
    counter = [0]*N
    rc = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        rc[p-1] += x
    count(0, -1, 0)
    print(*counter)
p,q,r = map(int,input().split())

if p+q >= p+r or p+q >= q+r:
    print(p+q)

elif q+r >= p+q and q+r >= p+r:
    print(q+r)

elif p+r >= p+q and p+e >= q+r:
    print(p+r)

### FIXED CODE ###

p,q,r = map(int,input().split())

if p+q <= p+r and p+q <= q+r:
    print(p+q)

elif q+r <= p+q and q+r <= p+r:
    print(q+r)

elif p+r <= p+q and p+r <= q+r:
    print(p+r)
cnt=[0]*100002;input()
for x in map(int,input().split()):cnt[x]+=1;cnt[x+1]+=1;cnt[x+2]+=1
print(max(cnt))
#I understood

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

d = [0]*(max(a)+3)

for i in range(0,max(a)+1):
    c = a.count(i)
    d[i+1] += c
    d[i] += c
    d[i+2] += c

print(max(d))

### FIXED CODE ###

cnt=[0]*100002
input()
for x in map(int,input().split()):
    cnt[x]+=1
    cnt[x+1]+=1
    cnt[x+2]+=1
print(max(cnt))
import math

MOD = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
u = sorted(set(a))
if len(u) == 1:
    print(n)
    exit()
else:
    g = 1
    for x in u:
        g = (g * x) // math.gcd(g, x)
    b = 0
    for i in range(n):
        b = b + (g // a[i])
print(b%MOD)

### FIXED CODE ###

import fractions

MOD = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
u = sorted(set(a))
if len(u) == 1:
    print(n)
    exit()
else:
    g = 1
    for x in u:
        g = (g * x) // fractions.gcd(g, x)
    b = 0
    for i in range(n):
        b = b + (g // a[i])
print(b%MOD)
[print(a//t*b)for a,b,t in[[int(i)for i in input().split()]]

### FIXED CODE ###

[print(int((t+0.5)//a)*b)for a,b,t in[[int(i)for i in input().split()]]]
N = int(input())
S = input().strip()

def tree(N,s,index):
  if N <= index:
      if len(s) > 0:
          return 1
      else:
          return 0

  if S[index] in s:
      return tree(N,s, index + 1)
  else:
      return tree(N,s, index + 1) + tree(N,s + S[index], index + 1)


print(tree(N,"",0))




### FIXED CODE ###

N = int(input())
S = input()

words = {}

for s in S:
    if s in words.keys():
        words[s] += 1
    else:
        words[s] = 2

res = 1
for k in words.keys():
    res *= words[k]

print((res - 1) % 1000000007)
a, b = map(int,input().split())
c = list(range(a,b+1))
num = 1
for i in c:
  num *= i
if num > 0:
  print("Positive")
elif num < 0:
  print("Negative")
else:
  print("Zero")

### FIXED CODE ###

a, b = map(int,input().split())
if a <=0 and b >= 0:
  print("Zero")
elif (b-a) % 2 == 0 and a < 0 and b < 0:
  print("Negative")
elif a ==0 or b == 0:
  print("Zero")
else:
  print("Positive")
n = int(input())
tree = [None for i in range(n)]
root = set(range(n))

for i in range(n):
    i, l, r = map(int, input().split())
    left[i] = l
    right[i] = r
    root -= {1, r}

def preorder(i):
    if i == -1:
        return
    print(' ', i, sep = '')
    preorder(left[i])
    preorder(right[i])
      
def inorder(i):
    if i == -1:
        return
    inorder(left[i])
    print(' ', i, sep = '')
    inorder(right[i])
      
def postorder(i):
    if i == -1:
        return
    postorder(left[i])
    postorder(right[i])
    print(' ', i, sep = '')

print('Preorder')
preorder(root)
print()
  
print('Inorder')
inorder(root)
print()
  
print('Postorder')
postorder(root)
print()

### FIXED CODE ###

n = int(input())
left = [None for i in range(n)]
right = [None for i in range(n)]
root = sum(range(n)) - n - 1

for i in range(n):
    i, l, r = map(int, input().split())
    left[i] = l
    right[i] = r
    root -= (l + r)

def Preorder(i):
    if (i == -1):
        return
    print(" {}".format(i), end = "")
    Preorder(left[i])
    Preorder(right[i])
      
def Inorder(i):
    if (i == -1):
        return
    Inorder(left[i])
    print(" {}".format(i), end = "")
    Inorder(right[i])
      
def Postorder(i):
    if (i == -1):
        return
    Postorder(left[i])
    Postorder(right[i])
    print(" {}".format(i), end = "")

print("Preorder")
Preorder(root)
print()
  
print("Inorder")
Inorder(root)
print()
  
print("Postorder")
Postorder(root)
print()
X = int(input())

A = 1
while True:
    b = (A ** 5 - X)
    c = abs(b) / b
    B = abs(b) ** (0.2)
    if int(B) == B:
        break
    A += 1
print(A, int(c * B))

### FIXED CODE ###

X = int(input())

A = []
for i in range(1000):
    A.append(i ** 5)

x, y = 0, 0

flag = False
for i, a in enumerate(A):
    for j, b in enumerate(A[i+1:]):
        if b - a == X:
            flag = True
            x = j + i + 1
            y = i
            break
        if a + b == X:
            flag = True
            x = i
            y = -(j + i + 1)
            break
    if flag:
        break
print(x, y)
a,b,c = map(int,input().split())
if (a+b+c)_max(a,b,c)==max(a,b,c):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c = map(int,input().split())
if ((a+b+c)-max(a,b,c))==max(a,b,c):
  print("Yes")
else:
  print("No")
from itertools import combinations

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

m = []
a = []
r = []
c = []
h = []
for i in range(N):
    if S[i][0] == 'M':
        m.append(S[i])
    elif S[i][0] == 'A':
        a.append(S[i])
    elif S[i][0] == 'R':
        r.append(S[i])
    elif S[i][0] == 'C':
        c.append(S[i])
    elif S[i][0] == 'H':
        h.append(S[i])

cnt = []
cnt.append(m.count)
cnt.append(a.count)
cnt.append(r.count)
cnt.append(c.count)
cnt.append(h.count)

com = list(combinations(range(5), 3))

ans = 0
for i in com:
    ans += cnt[i[0]]*cnt[i[1]]*cnt[i[2]]
print(ans)  

### FIXED CODE ###

from itertools import combinations

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

m = []
a = []
r = []
c = []
h = []
for i in range(N):
    if S[i][0] == 'M':
        m.append(S[i])
    elif S[i][0] == 'A':
        a.append(S[i])
    elif S[i][0] == 'R':
        r.append(S[i])
    elif S[i][0] == 'C':
        c.append(S[i])
    elif S[i][0] == 'H':
        h.append(S[i])

cnt = []
cnt.append(len(m))
cnt.append(len(a))
cnt.append(len(r))
cnt.append(len(c))
cnt.append(len(h))

com = list(combinations(range(5), 3))

ans = 0
for i in com:
    ans += cnt[i[0]]*cnt[i[1]]*cnt[i[2]]
print(ans)
a, b, c = (int(i) for i in input().split()) 
for i in range(c)
 if(i%2==0):
  a=a//2
  b=b+a//2
 else:
  b=b//2
  a=a+b//2
print(a,b)

   

### FIXED CODE ###

a, b, c= (int(i) for i in input().split())
for i in range(c):
 if(i%2==0):
  a=a//2
  b=b+a
 else:
  b=b//2
  a=a+b
print(a,b)
import sys
from collections import Counter

N, K, L = map(int, input().split())
edge1 = [[] for _ in range(N)]
edge2 = [[] for _ in range(N)]

for _ in range(K):
    p, q = map(int, sys.stdin.readline().split())
    edge1[p-1].append(q-1)
    edge1[q-1].append(p-1)

for _ in range(L):
    p, q = map(int, sys.stdin.readline().split())
    edge2[p-1].append(q-1)
    edge2[q-1].append(p-1)


def dfs(edges):
    groups = [-1]*N

    for i in range(N):
        if groups[i] != -1:
            continue

        groups[i] = i
        stack = [i]
        while stack:
            v = stack.pop()
            for dest in edges[v]:
                if groups[dest] != -1:
                    continue
                groups[dest] = i
                stack.append(dest)

    return groups


g1, g2 = dfs(edge1), dfs(edge2)
d = Counter()
for i in range(N):
    d[(g1[i], g2[i])] += 1

print(*(d[(g1[i], g2[i])] for i in range(N)))


### FIXED CODE ###

import sys

s = input()
s = s[::-1]

d ='maerd'
dr = 'remaerd'
e = 'esare'
er = 'resare'

i = 0
while True:
    try:
        if s[i:i+5] == d or s[i:i+5] == e:
            i += 5
            if i == len(s):
                print('YES')
                sys.exit(0)
        
        elif s[i:i+6] == er:
            i += 6
            if i == len(s):
                print('YES')
                sys.exit(0)
        
        elif s[i:i+7] == dr:
            i += 7
            if i == len(s):
                print('YES')
                sys.exit(0)
            
        else:
            print('NO')
            sys.exit(0)
            
    except Exception as err:
        print('NO')
        sys.exit(0)
a=input()
ca=a[0]
for c in a[1:]:
  if ca == c:
    print('Bad')
    return
  ca = c
print('Good')

### FIXED CODE ###

def main():
    a=input()
    ca=a[0]
    for c in a[1:]:
        if ca == c:
            print('Bad')
            return
        ca = c
    print('Good')

main()
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = int(x) * 3.8e5
  count += x
print(count)

### FIXED CODE ###

n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = float(x) * 3.8e5
  count += x
print(count)
from functools import lru_cache

N = int(input())
X = input()
x = int(X, 2)
y = X.count('1')
x1 = x % (y+1)
x2 = x % (y-1)

def f(n):
    if n == 0:
        return 0
    return 1 + f(n % bin(n).count('1'))

d = [0] * (2*10**5+5)
for i in range(2*10**5+5):
    d[i] = f(i)

for i in range(N):
    if x >>(N - i - 1) & 1:
        # print(f(x-pow(2, N-i-1)))
        print(d[(x2 - pow(2, N - i - 1, y-1)) % (y-1)] + 1)
    else:
        # print(f(x+pow(2, N-i-1)))
        print(d[(x1 + pow(2, N - i - 1, y+1)) % (y+1)] + 1)

### FIXED CODE ###

from functools import lru_cache

N = int(input())
X = input()
x = int(X, 2)
y = X.count('1')
if y == 1:
    x2 = 0
else:
    x2 = x % (y-1)
x1 = x % (y+1)

def f(n):
    if n == 0:
        return 0
    return 1 + f(n % bin(n).count('1'))

d = [0] * (2*10**5+5)
for i in range(2*10**5+5):
    d[i] = f(i)

for i in range(N):
    if x >>(N - i - 1) & 1:
        # print(f(x-pow(2, N-i-1)))
        if y - 1 == 0:
            print(0)
        else:
            print(d[(x2 - pow(2, N - i - 1, y-1)) % (y-1)] + 1)
    else:
        # print(f(x+pow(2, N-i-1)))
        print(d[(x1 + pow(2, N - i - 1, y+1)) % (y+1)] + 1)
def Ics(X, Y):
    m = len(X)
    n = len(Y)
    maxl = 0
    for i in range(m + 1):
        c[i][0] = 0
    for j in range(1, n + 1):
        c[0][j] = 0
    for i in range(1, m + 1):
        for j in range(1, n + 1):
            if(X[i] == Y[j]):
                c[i][j] = c[i - 1][j - 1] + 1
            elif(c[i - 1][j] <= c[i][j - 1]):
                c[i][j] = c[i- 1][j]
            maxl = max(maxl, c[i][j])
    return maxl

q = int(input().rstrip())
t = []
for i in range(n):
    s1 = input().rstrip()
    s2 = input().rstrip()
    t.append(lcs(s1, s2))
print(*t, sep="\n")

### FIXED CODE ###

def Ics(X, Y):
    m = len(X)
    n = len(Y)
    c1 = [0] * (n + 1)
    for i in range(m):
        d = X[i]
        c2 = c1[:]
        for j in range(n):
            if (d == Y[j]):
                c1[j + 1] = c2[j] + 1
            elif (c1[j + 1] < c1[j]):
                c1[j + 1] = c1[j]
    return (c1[-1])

q = int(input().rstrip())
t = []
for i in range(q):
    s1 = input().rstrip()
    s2 = input().rstrip()
    t.append(Ics(s1, s2))
print(*t, sep = "\n")
n=int(input())
l=list(map(int,input().split()))
c,f=0,l[0]/abs(l[0])
s=l[0]
for i in range(1,n,1):
  t=s+l[i]
  if s*t>0:
    s=-1*f
    c+=abs(t-s+1)
  else:
    f=-1*f
    s=s+l[i]
print(int(c))

### FIXED CODE ###

n=input()
a=[int(i) for i in input().split()]
def chk(a,t):
    ans=0
    x=0
    for i in a:
        x+=i
        if t==True and x<1:
            ans+=1-x
            x=1
        elif t==False and x>-1:
            ans+=x+1
            x=-1
        t=not t
    return ans
print(min(chk(a,True),chk(a,False)))
import sys
readline = sys.stdin.readline
n,m = list(map(int, readline().split()))
py = []
for _ in range(m):
    py.append(list(map(int, readline().split())))

spy = sorted(py, key=lambda x: x[1])

Y = {}
for i in range(m):
    Y[spy[i][1]] = 0

P = [0 for _ in range(m+1)]

for i in range(m):
    P[spy[i][0]] += 1
    Y[spy[i][1]] = P[spy[i][0]]

for i in range(m):
    print(str(py[i][0]).zfill(6) + str(Y[py[i][1]]).zfill(6))

### FIXED CODE ###

import sys
readline = sys.stdin.readline
n,m = list(map(int, readline().split()))
py = []
for _ in range(m):
    py.append(list(map(int, readline().split())))

spy = sorted(py, key=lambda x: x[1])

Y = {}
for i in range(m):
    Y[spy[i][1]] = 0

P = [0 for _ in range(n+1)]

for i in range(m):
    P[spy[i][0]] += 1
    Y[spy[i][1]] = P[spy[i][0]]

for i in range(m):
    print(str(py[i][0]).zfill(6) + str(Y[py[i][1]]).zfill(6))