Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    dp[1]=0 if a[0]==1 else 1
    for i in a:
        dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1]=dp[i]+dp[i-1]
    print(dp[N]%1000000007)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    if M!=0:
        dp[1]=0 if a[0]==1 else 1
        for i in a:
            dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()
a,b,c,x=map(int,input().split())
 
if:
  print(x)
elif x<a+b:
  print(int(a))
else:
  print(int(2*a+b-x))

### FIXED CODE ###

a,b,c,x=map(int,input().split())
 
if x<a:
  print(x)
elif x<a+b:
  print(a)
else:
  print(2*a+b-x)
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = 0

for i in range(1,a+1):
  if i >= b+1:
    e += d
    else:
      e += c
      print(e)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = 0

for i in range(1,a+1):
  if i >= b+1:
    e += d
  else:
    e += c
print(e)
n = int(input())
numList = list()
for i in range(n):
    numList.append(int(input()))
sum, ctr = 0, 1
for i in numList:
    if i == 0: continue
    elif i % 2 != 0 and ctr % 2 != 0:
        sum = sum + 1
    ctr = ctr + 1
print(sum)

### FIXED CODE ###

n = int(input())
S = list(map(int, input().split()))
ans = 0
for i in range(0, n, 2):
    if i%2 == 0 and S[i]%2 == 1:
        ans += 1
print(ans)
import sys
input = sys.stdin.readline
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort(reverse = True)
t = []
for _ in range(X): t.append(p.pop())
for _ in range(Y): t.append(q.pop())
t.sort()
for i in range(C):
  if t[i] < r[i]: t[i] = r[i]
print(sum(t))

### FIXED CODE ###

import sys
input = sys.stdin.readline
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort(reverse = True)
t = []
for _ in range(X): t.append(p.pop())
for _ in range(Y): t.append(q.pop())
t.sort()
for i in range(min(C, X + Y)):
  if t[i] < r[i]: t[i] = r[i]
print(sum(t))
w = list(input())
w.sort()
i = 0
if len(w) % 2 == 1:
    print('No')
    exit()

while i < len(w)-1:
	if w[i] != w[i+1]:
	    print('No')
            exit()
	i += 2
else:
	print('Yes')

### FIXED CODE ###

w = list(input())
w.sort()
i = 0
if len(w) % 2 == 1:
    print('No')
    exit()

while i < len(w)-1:
	if w[i] != w[i+1]:
		print('No')
		exit()
	i += 2
else:
	print('Yes')
n,k = map(int,input().split())
an = list(map(int, input().split()))
copyan = an[:]
i = copyan[0]
copyan[0]=10**6
movecount = 1
roopstart = 0
if i != 1:
    while True:
        memo = i
        i = copyan[i-1]
        
        
        if i >=30000:
            yokei = i%(10**6)
            
            break
        if k == movecount:
            print(i)
            exit()
        copyan[memo-1]=10**6 + movecount
        movecount += 1
        
else:
    print(1)
    exit()
roopnum = movecount - yokei
x = (k-yokei)%roopnum #移動する回数

ans = copyan.index(10**6+yokei+x) +1
print(ans)


### FIXED CODE ###

n,k = map(int,input().split())
an = list(map(int, input().split()))
copyan = an[:]
i = copyan[0]
copyan[0]=10**6
movecount = 1

if i != 1:
    while True:
        memo = i
        if k == movecount:
            print(i)
            
            exit()
        i = copyan[i-1]
        
        if i >=300000:
            yokei = i%(10**6)         
            break
        copyan[memo-1]=10**6 + movecount
        movecount += 1
        
else:
    print(1)
    exit()
roopnum = movecount - yokei
x = (k-yokei)%roopnum

ans = copyan.index(10**6+yokei+x) +1
print(ans)
str=input()
x,y=int(str.split(" "))
print(x*y)

### FIXED CODE ###

x,y=map(int,input().split(" "))
print(x*y,x*2+y*2)
N,M=map(int,input().split())
from collections import defaultdict
branch=defaultdict(set)
for i in range(M):
    a,b,c=map(int,input().split())
    branch[a]|={(b,c),}
def dps(now,score,visited,ans):
    if now==N:
        ans=max(score,ans)
    for b,c in branch[now]:
        if  b in visited:
            return 'inf'
        ans=dps(b,score+c,visited|{now,},ans)
    return ans
print(dps(1,0,set(),-1*float('inf')))

### FIXED CODE ###

N,M=map(int,input().split())
big=10**13
data=[-1*float('inf')]*(N+1)
from collections import defaultdict
branch=defaultdict(set)
for i in range(M):
    a,b,c=map(int,input().split())
    branch[a]|={(b,c),}
from collections import deque
check=deque()
check.append((1,0,set()))
data[1]=0
while len(check)>0:
    now=check.popleft()
    for b,c in branch[now[0]]:
        if now[1]+c>data[b]:
            if data[b]>big:continue
            if b in now[2]:
                data[b]=float('inf')
                check.append((now[0],float('inf'),now[2]|{now[0],b}))
                check.append((b,float('inf'),now[2]|{now[0],b}))
            else:
                data[b]=now[1]+c
                check.append((b,now[1]+c,now[2]|{now[0],}))
if data[N]>big:print('inf')
else:print(data[N])
num = int(input())
numbers = list(map(int,input().split()))
sum = 1
for i in range(num):
  sum *=numbers[i]
  if (sum>(10**18)):
  	print (-1)
    break
if sum<=(10**18):
  print (sum)

### FIXED CODE ###

num = int(input())
numbers = list(map(int,input().split()))
sum = 1
for i in range(num):
  sum *=numbers[i]
  if (sum>(10**18)):
    sum = -1
    break
if 0 in numbers:
  sum = 0
print (sum)
s = input()
ch = {chr(i) for i in range(ord('a'), ord('z')+1)}
for i in range(len(s)): ch.remove(s[i])
tmp = sorted(list(ch))
print(tmp[0] if len(tmp) else "None")

### FIXED CODE ###

s = input()
ch = {chr(i) for i in range(ord('a'), ord('z')+1)}
ss = set()
for i in range(len(s)): ss.add(s[i])
tmp = sorted(list(ch ^ ss))
print(tmp[0] if len(tmp) else "None")
n = input()
arrx = []
arry = []
for i in range(n):
  arrx[i].append(input())
  arry[i].append(input())
b = set()
c = set()
for i in range(n-1):
  b.add(arrx[i+1]-arr[i])
  c.add(arry[i+1]-arr[i])
if len(b)==len(c):
  print(len(b))
elif len(b)>len(c):
  pint(len(b))
else  :
  print(len(c))
  

### FIXED CODE ###

from collections import Counter
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
 
counter = Counter(((b1[0] - b2[0], b1[1] - b2[1])for b1 in xy for b2 in xy if b1 != b2))
print(N - (list(counter.most_common())+[(0,0)])[0][1])
N = int(input())
if N % 2: print(0)
else:
  ans = 0
  N //= 2
  while n > 0:
    ans += N // 5
    N //= 5
	print(ans)

### FIXED CODE ###

N = int(input())
if N % 2:
  print(0)
else:
  ans = 0
  N //= 2
  while N > 0:
    ans += N // 5
    N //= 5
  print(ans)
from bisect import bisect_right,bisect_left
import sys
N,H = map(int,input().split())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
B.sort()
ama=max(A)
x = bisect_right(B,ama)
ans = 0
if x ==N:
    if H%ama ==0:
        ans += H//ama 
    else:
        ans += H//ama +1
    print(ans)
    sys.exit()
for i in range(N-1,x-1,-1):
    if H<=0:
        print(ans)
        sys.exit()
    else H>0:
        H-=B[i]
        ans +=1
if H>0:
    if H%ama ==0:
        ans += H//ama 
    else:
        ans += H//ama +1
print(ans)

### FIXED CODE ###

from bisect import bisect_right,bisect_left
import sys
N,H = map(int,input().split())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
B.sort()
ama=max(A)
x = bisect_right(B,ama)
ans = 0
if x ==N:
    if H%ama ==0:
        ans += H//ama 
    else:
        ans += H//ama +1
    print(ans)
    sys.exit()
for i in range(N-1,x-1,-1):
    if H<=0:
        print(ans)
        sys.exit()
    else:
        H-=B[i]
        ans +=1
if H>0:
    if H%ama ==0:
        ans += H//ama 
    else:
        ans += H//ama +1
print(ans)
a,b = input().split()
print(a * b)

### FIXED CODE ###

a,b=(int(x) for x in input().split())
print(a * b)
inf = 2019
L, R = map(int, input().split())
ans = 2018
L = L % 2019
R = R % 2019
if L >= R:
    print(0)
    sys.exit
for i in range(L, R):
      
    for j in range(i + 1, R + 1):
        tmp = int((i * j) % inf)
        ans = min(ans, tmp)
        
print(ans)


### FIXED CODE ###

inf = 2019
L, R = map(int, input().split())
ans = 0
df = R - L
if df < 2019:
    L = L % inf
    R = L + df
    ans = 2019
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            tmp = int((i * j) % inf)
            ans = min(ans, tmp)

print(ans)
s=[]

while 1:
        l1=list(input().split())
        if l1==".":
            break
        l2=list(input().split())

        if l1==l2:
            s+=["INDENTCAL"]
        elif len(set(l1+l2))==1:
            s+=["CLODSE"]
        else:
            s+=["DIFFERENT"]


print(s)


### FIXED CODE ###

s=[]

while 1:
    l1=input()
    if l1==".":
        break
    l2=input()

    sp1=l1.split('"')
    sp2=l2.split('"')
    
    t=0
    if len(sp1)==len(sp2):
        for i in range(len(sp1)):
            if i%2==1 and sp1[i]!=sp2[i]:
                t+=1
            elif i%2!=1 and sp1[i]!=sp2[i]:
                t+=2


    if sp1==sp2:
        s+=["IDENTICAL"]
    elif t==1:
        s+=["CLOSE"]
    else:
        s+=["DIFFERENT"]

for x in s:
    print(x)
S = list(input())

count = 0

for i in range(len(S)//2):
  if S[i]!=S[-(i+1)]
  	count = count + 1
   
  
print(count)

### FIXED CODE ###

S = list(input())

count = 0

for i in range(len(S)//2):
  if S[i]!=S[-(i+1)]:
  	count = count + 1
   
  
print(count)
a = input()
n = len(a)
if (a[n]==3):
  print(bon)
elif(a[n] in [0,1,6,8]):
  print(hon)
else:
  print(pon)

### FIXED CODE ###

a = input()
n = len(a)
if (int(a[n-1])==3):
  print("bon")
elif(int(a[n-1]) in [0,1,6,8]):
  print("pon")
elif(int(a[n-1]) in [2,4,5,7,9]):
  print("hon")
a=input()
a[3]="8"
print(a)

### FIXED CODE ###

a=input()
a=a.replace("2017","2018")
print(a)
import numpy as np
H, W, K = map(int, input().split())
p = 10**9 + 7
r = [1, 1, 2, 3, 5, 8, 13, 21, 34]
dp = np.zeros([H + 1, W], dtype=int)
dp[0, 0] = 1
for h in range(H):
    for w in range(W):
        if w != 0:
            dp[h+1, w] += ((dp[h, w-1] * r[w-1])%p * r[W-1-w])%p
        dp[h+1, w] += ((dp[h, w] * r[w])%p * r[W-1-w])%p
        if w != W-1:
            dp[h+1, w] += ((dp[h, w+1] * r[w])%p * r[W-2-w])%p
        dp[h+1, w] = dp[h+1, w]%p
print(dp[H, K-1])

### FIXED CODE ###

X, Y = map(int, input().split())
print(X + Y//2)
X=input(int())
 
if X=>30 :
  print("Yes")
else :
  print("No")

### FIXED CODE ###

print("Yes") if int(input()) >= 30 else print("No")
import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

N, A = map(int, input().split())
x = readints()

sum = 0
for i in range(N):
    sum += x[i]

dp = [[[0]*(55) for _ in range(55)] for _ in range(3000)]
dp[0][0][0] = 1
for i in range(N):
    for j in range(N+1):
        for k in range(N*A):
            dp[i+1][j][k] += dp[i][j][k]
            if k >= x[i]:
                dp[i+1][j+1][k] += dp[i][j][k-x[i]]
ans = 0
for j in range(1, N+1):
    ans += dp[N][j][j*A]
print(ans)


### FIXED CODE ###

import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

N, A = map(int, input().split())
x = readints()

sum = 0
for i in range(N):
    sum += x[i]

dp = [[[0]*(3000) for _ in range(55)] for _ in range(55)]
dp[0][0][0] = 1
for i in range(N):
    for j in range(N+1):
        for k in range(2900):
            dp[i+1][j][k] += dp[i][j][k]
            if k >= x[i]:
                dp[i+1][j+1][k] += dp[i][j][k-x[i]]
ans = 0
for j in range(1, N+1):
    ans += dp[N][j][j*A]
print(ans)
n=int(input())
stones=list(map(int, input.split()))
infini=(10**4)*(10**5)
dp = [infini for _ in range(n)]
dp[0]=0
dp[1]=stones[1]
for pos in range(1, n):
  dp[pos] = stones[pos] + min(dp[pos-1], dp[pos-2])

  print(dp[-1])

### FIXED CODE ###


n=int(input())
stones=list(map(int, input().split()))
infini=(10**4)*(10**5)
dp = [infini for _ in range(n)]
dp[0]=0

for pos in range(0, n-1):
   dp[pos+1] = min(dp[pos+1], dp[pos] + abs(stones[pos] - stones[pos+1]))
   if pos <= n-3:
      dp[pos+2] = min(dp[pos+2], dp[pos] + abs(stones[pos] - stones[pos+2]))
print(dp[-1])
a,b=map(int,input())
if(a>0):print("Positive")
elif(a==0):print("Zero")
else:
  if(b>=0):print("Zero")
  else:
    if((b-a+1)%2==0):print("Positive")
    else:print("Negative")

### FIXED CODE ###

a,b=map(int,input().split())
if(a>0):print("Positive")
elif(a==0):print("Zero")
else:
  if(b>=0):print("Zero")
  else:
    if((b-a+1)%2==0):print("Positive")
    else:print("Negative")
from math import gcd
import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)

K = int(input())

ans = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans += gcd(gcd(i,j), k)
print(ans)


### FIXED CODE ###

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

x = N % K

ans = min(x,K-x)

print(ans)
import numpy as np

def lcm(a,b):
    return a*b//np.gcd(a,b)


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


### FIXED CODE ###

from fractions import gcd

def lcm(a,b):
    return a*b//gcd(a,b)


A,B=map(int,input().split())
print(lcm(A,B))
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(N)]

for i in range(N-M+1):
  for j in range(N-M+1):
    
    for k in range(M):
      if A[i+k][j:j+M] != B[k]:
        break
    else:
      print('Yes')
      exit()
      
    break

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):
    
    for k in range(M):
      if A[i+k][j:j+M] != B[k]:
        break
    else:
      print('Yes')
      exit()

print('No')
import sys
input = sys.stdin.readline
from collections import deque
n = int(input())
a = list(map(int,input().split()))
ls = [[0 for i in range(n)] for j in range(n)]
for i in range(n):
  for j in range(n):
    ls[i][j] = min(i,j,n-1-i,n-1-j)
ans = 0
st = set()
for i in a:
  x,y = divmod(i-1,n)
  ans += ls[x][y]
  set.add((x,y))
  q = deque([(x,y)])
  while q:
    px,py = q.popleft()
    for nx,ny in (px-1,py),(px+1,py),(px,py+1),(px,py-1):
      if 0 <= nx < n and 0 <= ny < n:
        if (nx,ny) in st:
          if ls[px][py] < ls[nx][ny]:
            ls[nx][ny] = ls[px][py]
        elif ls[px][py]+1 < ls[nx][ny]:
          ls[nx][ny] = ls[px][py]+1
          q.append((nx,ny))
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import deque
n = int(input())
a = list(map(int,input().split()))
n += 2
ls = [0 for i in range(n*n)]
for i in range(n):
  for j in range(n):
    ls[i*n+j] = min(i,j,n-1-i,n-1-j)-1
ans = 0
st = [0]*(n*n)
for i in a:
  x,y = divmod(i-1,n-2)
  i = (x+1)*n+(y+1)
  ans += ls[i]
  st[i]=1
  q = deque([i])
  while q:
    j = q.popleft()
    for k in (j-n,j+n,j+1,j-1):
      if st[j]:
        if ls[j] < ls[k]:
          ls[k] = ls[j]
          q.append(k)
      elif ls[j]+1 < ls[k]:
        ls[k] = ls[j]+1
        q.append(k)
print(ans)
N,L=map(int,input().split(" "))


A=[]
for i in range(N):
    a=L+i
    A.append(a)

T=0
for i in range(N):
    T+=A[i]    

if T>=0:
    A.pop(0)
else:
    A.pop(N)

T2=0
for i in range(N-1):
    T2+=A[i]

print(T2)


### FIXED CODE ###

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

Apple_List1=[]
Apple_List2=[]
for i in range(N):
    Apple_List1.append(L+i)
    Apple_List2.append(abs(L+i))

#Apple_List=abs(Apple_List)
Apple_List2.sort()

flag=0
if Apple_List2[0] in Apple_List1:
    flag=1
elif -Apple_List2[0] in Apple_List1:
    flag=-1
    
print(sum(Apple_List1)-flag*Apple_List2[0])
import math

L = int(input())

N = math.floor(math.log2(L)) + 1
ans = []
for i in range(1, N):
    ans.append((i, i+1, 0))
    ans.append((i, i+1, 2**(N-i-1)))

tmp = 2 ** (N-1)
for j in range(N-1):
    if L >> j & 1:
        ans.append((1, N-j, (L >> (j+1)) << (j+1)))

print(N, len(ans))
for ans_i in ans:
    print(*ans_i)


### FIXED CODE ###

import math

L = int(input())

N = math.floor(math.log(L, 2)) + 1
ans = []
for i in range(1, N):
    ans.append((i, i+1, 0))
    ans.append((i, i+1, 2**(N-i-1)))

tmp = 2 ** (N-1)
for j in range(N-1):
    if L >> j & 1:
        ans.append((1, N-j, (L >> (j+1)) << (j+1)))

print(N, len(ans))
for ans_i in ans:
    print(*ans_i)
H,W = map(int,input().split())
A = [list(input()) for _ in range(H)]
C = {chr(i):0 for i in range(97,123)}
for i in range(H):
    for j in range(W):
        C[A[i][j]] += 1
if H%2==0 and W%2==0:
    flag = 0
    for a in C:
        if C[a]%4!=0:
            flag = 1
            break
elif H%2==0 and W%2==1 or H%2==1 and W%2==0:
    flag = 0
    for a in C:
        if (C[a]%4)%2!=0:
            flag = 1
        break
else:
    flag = 0
    cnt = 0
    for a in C:
        if C[a]%2==1:
            cnt += 1
    if cnt!=1:
        flag = 1
if flag==0:
    Print("Yes")
else:
    print("No")

### FIXED CODE ###

H,W = map(int,input().split())
C = {chr(i):0 for i in range(97,123)}
for _ in range(H):
    s = input().strip()
    for j in range(W):
        C[s[j]] += 1
ind1 = 0
for i in range(97,123):
    if C[chr(i)]==1:
        ind1 = C[chr(i)]
D = {0:0, 1:0, 2:0,3:0}
D1 = {0:0,1:0,2:0,3:0}
for c in C:
    D[C[c]%4] += 1
    D1[C[c]%4] += C[c]
if H%2==0 and W%2==0:
    if D[1]==0 and D[2]==0 and D[3]==0:
        flag = "Yes"
    else:
        flag = "No"
elif H%2==0 and W%2==1:
    if D[1]+D[3]>0:
        flag = "No"
    else:
        m = H//2
        if m>=D[2]:
            flag = "Yes"
        else:
            flag = "No"
elif H%2==1 and W%2==0:
    if D[1]+D[3]>0:
        flag = "No"
    else:
        m = W//2
        if m>=D[2]:
            flag = "Yes"
        else:
            flag = "No"
else:
    if D[1]+D[3]!=1:
        flag = "No"
    else:
        m = (H+W-1)//2
        if m>=D[2]:
            flag = "Yes"
        else:
            flag = "No"
print(flag)
a = str.input()
if a.isupper:
  print("A")
else:
  print("a")

### FIXED CODE ###

a = str(input())
if str.isupper(a):
  print("A")
else:
  print("a")
A,B,N = list(map(int , input().split()))

if N>B:
    x = B -1
else:
    x = N
D = []

if N > 10:
    w = N % 10
else:
    w = N-1
for i in range(w):
    F1 = (A*(x-i))//B
    F2 = A * ((x-i)//B)
    S = F1 - F2
    D.append(S)

ans = max(D)
print(ans)

### FIXED CODE ###

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

if N>B:
    x = B -1
else:
    x = N
D = []

if N > 20:
    w = N % 15 + 5
elif N > 4:
    w = N-1
else:
    w = N
for i in range(w):
    F1 = (A*(x-i))//B
    F2 = A * ((x-i)//B)
    S = F1 - F2
    D.append(S)

ans = max(D)
print(ans)
from sys import stdin

N = int(input())
sum = 0
for i in N:
  X = input().split()
  if x[1] == 'JPY':
    sum += float(x[1])
  else:
  	sum += float(x)*380000
print(sum)


### FIXED CODE ###

N = int(input())
sum = 0
for i in range (N):
  X = input().split()
  if X[1] == 'JPY':
    sum += float(X[0])
  else:
  	sum += float(X[0])*380000
print(sum)
import sys
input = sys.stdin.readline

s = input()
mod = 10**9+7
dp = [[0]*13 for _ in range(len(s))]
t = [1]
for i in range(len(s)-1):
    t.append(t[-1]*10%13)
t.reverse()
#print(t)
if (s[0]=="?"):
    for i in range(10):
        dp[0][t[0]*i%13] = +1
else:
    dp[0][t[0]*int(s[0])%13] += 1
for i in range(1,len(s)):
    if (s[i]=="?"):
        for j in range(13):
            for k in range(10):
                dp[i][(j + t[i]*k)%13] += dp[i-1][j]
                dp[i][(j + t[i]*k)%13] %= mod
    else:
        for j in range(13):
            #print(i,j,(j + t[i]*int(s[i]))%13)
            dp[i][(j + t[i]*int(s[i]))%13] += dp[i-1][j]
            dp[i][(j + t[i]*int(s[i]))%13] %= mod             
#print(dp)
print(dp[len(s)-1][5])

### FIXED CODE ###

s = input()
mod = 10**9+7
dp = [[0]*13 for _ in range(len(s))]
t = [1]
for i in range(len(s)-1):
    t.append(t[-1]*10%13)
t.reverse()
#print(t)
if (s[0]=="?"):
    for i in range(10):
        dp[0][t[0]*i%13] = +1
else:
    dp[0][t[0]*int(s[0])%13] += 1
for i in range(1,len(s)):
    if (s[i]=="?"):
        for j in range(13):
            for k in range(10):
                dp[i][(j + t[i]*k)%13] += dp[i-1][j]
                dp[i][(j + t[i]*k)%13] %= mod
    else:
        for j in range(13):
            #print(i,j,(j + t[i]*int(s[i]))%13)
            dp[i][(j + t[i]*int(s[i]))%13] += dp[i-1][j]
            dp[i][(j + t[i]*int(s[i]))%13] %= mod             
#print(dp)
print(dp[len(s)-1][5])
def kakezan():
    if (1 <= a <= 9) and (1 <= b <= 9):
        return a * b
    else:
        return -1

a = int(input())
b = int(input())

print(kakezan())

### FIXED CODE ###

def kakezan():
    if (1 <= a <= 9) and (1 <= b <= 9):
        return a * b
    else:
        return -1

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

print(kakezan())
a=input()
b=input()
if len(a)==len(b):
  if a==b:
    print("EQUAL")
  elif a<b:
    print("LESS")
  else a>b:
    print("GREATER")
elif len(a)<len(b):
  print("LESS")
else:
  print("GREATER")

### FIXED CODE ###

a=input()
b=input()
if len(a)==len(b):
  if a==b:
    print("EQUAL")
  elif a<b:
    print("LESS")
  else:
    print("GREATER")
elif len(a)<len(b):
  print("LESS")
else:
  print("GREATER")
N,Q=map(int,input().split())
S=input()
L=[]
R=[]
C=[0]*N
c=0
for i in range(Q):
    A=list(map(int,input().split()))
    L.append(A[0])
    R.append(A[1])
for i in range(N-1):
    if S[i]=="A" and S[i+1]=="C":
        c+=1
        C[i]=c
    else:
        C[i]=c
C[N-1]=c
for i in range(Q):
    if S[R[i]-1]=="A" and S[R[i]]=="C":
        print(C[R[i]-1]-C[L[i]-1]-1)
    else:
        print(C[R[i]-1]-C[L[i]-1]+1)
print(C)

### FIXED CODE ###

N,Q=map(int,input().split())
S=input()
L=[]
R=[]
C=[0]*N
c=0
for i in range(Q):
    A=list(map(int,input().split()))
    L.append(A[0])
    R.append(A[1])
for i in range(N-1):
    if S[i]=="A" and S[i+1]=="C":
        c+=1
        C[i]=c
    else:
        C[i]=c
C[N-1]=c
S+="X"
for i in range(Q):
    p=0
    if S[R[i]-1]=="A" and S[R[i]]=="C":
        p=C[R[i]-1]-C[L[i]-1]-1
    else:
        p=C[R[i]-1]-C[L[i]-1]
    if S[L[i]-1]=="A" and S[L[i]]=="C":
        p+=1
    print(p)
m=int(input())
ans=0
for i in range(n+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)



### FIXED CODE ###

m=int(input())
ans=0
for i in range(1,m+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)
x=input().split()
a=int(x[0])
b=int(x[1])
print("%d %d %f"%(a//b, a%b, a/b)


### FIXED CODE ###

x=input().split()
a=int(x[0])
b=int(x[1])
print("%d %d %f"%(a//b, a%b, a/b))
a=int(input())
b=int(input())
S=a*b
L=a*2+b*2
print(S, ,L)

### FIXED CODE ###

lis=0
S=0
L=0
lis=input().split()
S=int(lis[0])*int(lis[1])
L=int(lis[0])*2+int(lis[1])*2
print(S,L)
A, B = map(int, imput().split())

if A/B == 0:
  print(A+B)
else:
  print(B-A)

### FIXED CODE ###

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

if B % A == 0:
  print(A+B)
else:
  print(B-A)