Harryxun/stf_run huggingface dataset:
from collections import Counter

n = int(input())
v = list(map(int, input().split()))
for_set_v = v # set用
set_v = set(v)
even = []
odd = []
count = 0 # 置き換えた回数
count_list = []
for num in range(n):
    if num % 2 == 0:
        even.append(v[num])
    else:
        odd.append(v[num])

even_most = Counter(even).most_common()
odd_most = Counter(odd).most_common()
#print(even_most)
#print(odd_most)
if len(set(v)) >= 2:
    if even_most[0][0] != odd_most[0][0]:
        if len(set(even)) != 1:
            count += (n/2) - int(even_most[0][1])
        if len(set(odd)) != 1:
            count += (n/2) - int(odd_most[0][1])
    else:
        try:
            count_list.append(n-int(even_most[0][1])-int(odd_most[1][1]))
            count_list.append(n-int(even_most[1][1])-int(odd_most[0][1]))
            #print(count_list)
            count += int(min(count_list))
        except:
            if len(even_most) == 1:
                count += (n/2)-int(odd_most[1][1])
            elif len(odd_most) == 1:
                count += (n/2)-int(even_most[1][1])
else:
    count += (n/2)
print(int(count))


### FIXED CODE ###

n = list(input())
result = ''
for num in n:
    if num == '1':
        result += '9'
    elif num == '9':
        result += '1'
print(int(result))
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
k=0
m=lcm_list(l)-1
for i in range(n):
    k+=m%l[i]
print(k)

### FIXED CODE ###

from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
k=0
m=lcm_list(a)-1
for i in range(n):
    k+=m%a[i]
print(k)
def main():
    #入力
    readline=stdin.readline
    n,y=map(int,readline().split())

    flag=False
    for i in range(0,n+1):
        for j in range(0,n+1):
            if n<i+j: continue
            k=n-i-j
            if 10000*i+5000*j+1000*k==y:
                print(i,j,k)
                flag=True
                break
        if flag: break

    if flag==False: print(-1,-1,-1)

if __name__=="__main__":
    main()

### FIXED CODE ###

from sys import stdin
def main():
    readline=stdin.readline
    N,Y=map(int,readline().split())

    flag=False
    for i in range(N+1):
        for j in range(N+1):
            m=10000*i+5000*j
            if m>Y:
                break
            else:
                k=(Y-m)//1000
                m+=1000*k
                if i+j+k==N:
                    print(i,j,k)
                    flag=True
                    break
        if flag:
            break
    if flag==False:
        print(-1,-1,-1)

if __name__=="__main__":
    main()
import sympy

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

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

cities.append(K)

cities.sort()

dif = []

for i in range(N):
    dif.append(cities[i+1] - cities[i])
    

if len(dif) == 1:
    x = dif[0]

else:
    
    x = sympy.gcd(dif[0],dif[1])

    for i in range(2,N):
        x = sympy.gcd(x,dif[i])

print(x)

### FIXED CODE ###

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

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

cities.append(K)

cities.sort()

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

dif = []

for i in range(N):
	dif.append(cities[i+1] - cities[i])
    

if len(dif) == 1:
	x = dif[0]

else:
    
	x = gcd(dif[0],dif[1])

	for i in range(2,N):
		x = gcd(x,dif[i])

print(x)
H,W = map(int, input().split())

table = []

for i in range(H):
	table.append(list(input()))


def check(x,y):
	if table[y-1][x]=='#' or table[y+1][x]=='#' or table[y][x-1]=='#' or table[y][x+1]=='#' :
		return
	else:
		print ('No')
		quit()
		

for y in range(H):
	for x in range(W):
		check(x,y)

print ('Yes')		

### FIXED CODE ###

H,W = map(int, input().split())

table = []

for i in range(H):
	table.append(list(input()))

counter = 0
	
def check(x,y):
	counter = 0
			
	if x > 0:
		if table[y][x-1] == '#':
			counter += 1
			
	if x < W-1:
		if table[y][x+1] == '#':
			counter += 1
	
	if y > 0:
		if table[y-1][x] == '#':
			counter += 1
	
	if y < H-1:
		if table[y+1][x] == '#':
			counter += 1
	
	if counter == 0:
		print('No')
		quit()
			
	

for y in range(H):
	for x in range(W):
		if table[y][x] == '#':
			check(x,y)

print ('Yes')
s = input()
n = len(s) - 1
sum = 0

if n == 0:
    print(s)
    return

for bit in range(1 << n):
    eval_str = ''
    for i in range(n):
        eval_str += s[i]
        if bit & (1 << i):
            eval_str += '+'
    eval_str += s[i + 1]
    sum += eval(eval_str)

print(sum)

### FIXED CODE ###

s = input()
n = len(s) - 1
sum = 0

for bit in range(1 << n):
    eval_str = ''
    eval_str += s[0]
    for i in range(n):
        if bit & (1 << i):
            eval_str += '+'
        eval_str += s[i + 1]
    sum += eval(eval_str)

print(sum)
while True:
  m, f, r = map(int, raw_input().split())
  if m == -1 and f == -1 and r == -1:
    break
  if m == -1 or f == -1 or m + f < 30:
    print 'F'
  elif m + f >= 80:
    print 'A'
  elif m + f >= 65 and m + f < 80:
    print 'B':
  elif m + f >= 50 and m + f < 65:
    print 'C'
  elif m + f >= 30 and m + f < 50:
    if r >= 50:
      print 'C'
    else:
      print 'D'

### FIXED CODE ###

while True:
  m, f, r = map(int, raw_input().split())
  if m == -1 and f == -1 and r == -1:
    break
  if m == -1 or f == -1 or m + f < 30:
    print 'F'
  elif m + f >= 80:
    print 'A'
  elif m + f >= 65 and m + f < 80:
    print 'B'
  elif m + f >= 50 and m + f < 65:
    print 'C'
  elif m + f >= 30 and m + f < 50:
    if r >= 50:
      print 'C'
    else:
      print 'D'
ip=input().strip()
while((len)==0):
  ip=input().strip()
m,d=map(int,ip.split())
m1,d1=map(int,input().split())
odd=[1,3,5,7,8,10,12]
eve=[4,6,9,11]
if m in odd:
  if(d==31):
    print(1)
  else:
    print(0)
elif m in even:
  if(d==30):
    print(1)
  else:
    print(0)
else:
  if(d==28):
    print(1)
  else:
    print(0)

### FIXED CODE ###

ip=input().strip()
while((len)==0):
  ip=input().strip()
m,d=map(int,ip.split())
m1,d1=map(int,input().split())
odd=[1,3,5,7,8,10,12]
eve=[4,6,9,11]
if m in odd:
  if(d==31):
    print(1)
  else:
    print(0)
elif m in eve:
  if(d==30):
    print(1)
  else:
    print(0)
else:
  if(d==28):
    print(1)
  else:
    print(0)
import math
r = int(input())
print("{} {}".format(math.pi * r ** 2, 2 * math.pi * r))

### FIXED CODE ###

import math
r = float(input())
print("{} {}".format(math.pi * r ** 2, 2 * math.pi * r))
for i in range(input()):
    s=raw_input()
    cur=0
    for j in range(input()):
        cmd=raw_input()
        if cmd=="forward char":
            cur=min(cur+1,len(s))
        elif cmd=="forward word":
            while cur<len(s) and s[cur]==" ":
                cur+=1
            while cur<len(s) and s[cur]!=" ":
                cur+=1
        elif cmd=="backward char":
            cur=max(cur-1,0)
        elif cmd=="backward word":
            while cur>0 and s[cur-1]==" ":
                cur-=1
            while cur>0 and s[cur-1]!=" ":
                cur-=1
        elif cmd=="delete char":
            if cur!=len(s):
                s=s[:cur]+s[cur+1:]
        elif cmd=="delete word":
            temp=cur
            if temp>=len(s):
                continue
            while s[temp]==" ":
                temp+=1
            if temp>=len(s):
                continue
            while temp<len(s) and s[temp]!=" ":
                temp+=1
            s=s[:cur]+s[temp:]
        elif "insert" in cmd:
            idx1=cmd.find('"')
            idx2=cmd.find('"',idx1+1)
            s=s[:cur]+cmd[idx1+1:-1]+s[cur:]
            cur+=idx2-idx1-1
    print s[:cur]+"^"+s[cur:]

### FIXED CODE ###

for i in range(input()):
    s=raw_input()
    cur=0
    for j in range(input()):
        cmd=raw_input()
        if cmd=="forward char":
            cur=min(cur+1,len(s))
        elif cmd=="forward word":
            while cur<len(s) and s[cur]==" ":
                cur+=1
            while cur<len(s) and s[cur]!=" ":
                cur+=1
        elif cmd=="backward char":
            cur=max(cur-1,0)
        elif cmd=="backward word":
            while cur>0 and s[cur-1]==" ":
                cur-=1
            while cur>0 and s[cur-1]!=" ":
                cur-=1
        elif cmd=="delete char":
            if cur!=len(s):
                s=s[:cur]+s[cur+1:]
        elif cmd=="delete word":
            temp=cur
            if temp>=len(s):
                continue
            while temp<len(s) and s[temp]==" ":
                temp+=1
            if temp>=len(s):
                continue
            while temp<len(s) and s[temp]!=" ":
                temp+=1
            s=s[:cur]+s[temp:]
        elif "insert" in cmd:
            idx1=cmd.find('"')
            idx2=cmd.find('"',idx1+1)
            s=s[:cur]+cmd[idx1+1:-1]+s[cur:]
            cur+=idx2-idx1-1
    print s[:cur]+"^"+s[cur:]
n,m = map(int,input().split())
s = []
c = []
for i in range(m):
    val1,val2 = map(int,input().split())
    s.append(val1)
    c.append(val2)

digit = max(s) - min(s)

ans = []

for i in range(10 ** digit + 1,10 ** (digit + 1)):
    num = str(i)
    flg = 0
    for j in range(m):
        if num[s[j]-1] == str(c[j]):
            flg = 1
        else:
            flg = 0
            break
    if flg == 1:
        ans.append(i)

if ans:
    print(min(ans))
else:
    print(-1)

### FIXED CODE ###

n,m = map(int,input().split())
s = []
c = []
for i in range(m):
    val1,val2 = map(int,input().split())
    s.append(val1)
    c.append(val2)

for i in range(1000):
    if len(str(i)) == n:
        flg = True
        for j in range(m):
            if int(str(i)[s[j] - 1]) != c[j]:
                    flg = False
        if flg:
            print(i)
            break
if not flg:
    print(-1)
import math

#S     G     S
#RRR..RLL...LRR...

s = list(input())
leng = len(s)
tmp = "R"
s[0] = "S"

for i in range(1,leng):
    if s[i] == "L":
        if tmp == "R":
            s[i] = "G"
        tmp = "L"
    else:
        if tmp == "L":
            s[i] = "S"
        tmp = "R"
print(s)

lis = [0]*(leng)
tmp_s = 0

for i in range(1,leng):
    if s[i] == "S" or i == leng-1:
        if i == leng-1:
            i += 1
        if (tmp_g - tmp_s) % 2 == 0:
            lis[tmp_g-1] = math.floor((i - tmp_s)/2)
            lis[tmp_g] = math.floor((i - tmp_s)/2 + 0.5)
        else:
            lis[tmp_g-1] = math.floor((i - tmp_s)/2 + 0.5)
            lis[tmp_g] = math.floor((i - tmp_s)/2)
        tmp_s = i
        continue
    if s[i] == "G":
        tmp_g = i
    continue

print (*lis)

### FIXED CODE ###

import math
import sys
sys.setrecursionlimit(100000)

#S     G     S
#RRR..RLL...LRR...

s = list(input())
leng = len(s)
tmp = "R"
s[0] = "S"

for i in range(1,leng):
    if s[i] == "L":
        if tmp == "R":
            s[i] = "G"
        tmp = "L"
    else:
        if tmp == "L":
            s[i] = "S"
        tmp = "R"
lis = [0]*(leng)
tmp_s = 0
tmp_g = leng - 1

for i in range(1,leng):
    if s[i] == "G":
        tmp_g = i
    if s[i] == "S" or i == leng-1:
        if i == leng-1:
            i += 1
        if (tmp_g - tmp_s) % 2 == 0:
            lis[tmp_g-1] = math.floor((i - tmp_s)/2)
            lis[tmp_g] = math.floor((i - tmp_s)/2 + 0.5)
        else:
            lis[tmp_g-1] = math.floor((i - tmp_s)/2 + 0.5)
            lis[tmp_g] = math.floor((i - tmp_s)/2)
        tmp_s = i
        continue

    continue

print (*lis)
n = int(input())
a = str(input())
b = str(input())

L =[(a+b)*n]

for i in range(n+1):
  if a == 0:
    print(b*n)
  else:
    print(b.count(n))

### FIXED CODE ###

N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)
s=int(input())
a = [int(c) for c in s]
if a[0]==7 or a[1]==7 or a[2]==7:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s=(input())
a = [int(c) for c in s]
if a[0]==7 or a[1]==7 or a[2]==7:
    print('Yes')
else:
    print('No')
times = int(input())
ans = 0
type = 1
num = map(int,input().split(" "))
num.sort(reverse=Ture)
for i in num:
    if type % 2:
        ans += i
    else:
        ans -= i
    type += 1
    
print(ans)

### FIXED CODE ###

times = int(input())
ans = 0
type = 1
num = list(map(int,input().split(" ")))
num.sort(reverse=True)
for i in num:
    if type % 2:
        ans += i
    else:
        ans -= i
    type += 1
    
print(ans)
import heapq

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
BC = [list(map(int,input().split())) for _ in range(M)]
BC = sorted(BC,reverse=True,key=lambda x: x[1])
i = 0

for B,C in BC:
    if A[i] >= C:
        break
    for a in A[i:]:
        if a < C and B != 0:
            A[i] = C
            B -= 1
            i += 1
        else:
            break
print(sum(A))

### FIXED CODE ###

import sys

def input():
    return sys.stdin.readline().strip()

def main():

    N,M = map(int,input().split())
    A = sorted(list(map(int,input().split())))
    BC = [list(map(int,input().split())) for _ in range(M)]
    BC = sorted(BC,reverse=True,key=lambda x: x[1])
    D = []

    for B,C in BC:
        for b in range(B):
            if len(D) != N:
                D.append(C)
            else:
                break
        else:
            continue
        break

    for i in range(len(D)):
        if A[i] < D[i]:
            A[i] = D[i]
        else:
            break

    print(sum(A))

if __name__ == "__main__":
    main()
import sys,itertools
input = sys.stdin.readline
N = int(input().strip())
S = input().strip()

le = [S.count(s) for s in set(S)]
cnt = 0
for i in range(len(le)):
    for s in itertools.combinations(le,i+1):
        t=1
        for tt in [x for x in s if x > 1]:
            t*=tt
        cnt+=t
print(cnt%((10**9)+7)

### FIXED CODE ###

import sys,itertools
input = sys.stdin.readline
N = int(input().strip())
S = input().strip()

le = [S.count(s)+1 for s in set(S)]
cnt=1
for i in le:
    cnt*=i
print((cnt-1)%((10**9)+7))
a = int(input())
b = int(input())

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

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

else:
 print('none')

### FIXED CODE ###

a, b = map(int, input().split())
if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
s = input()
koho = []
for i in range(len(s)-2):
    S = int(s[i:i+3])
    sa = abs(S - 753)
    koho.append(sa)
print(min(koho))

### FIXED CODE ###

X = int(input())
if X == 7 or X == 5 or X == 3:
    print('YES')
else:
    print('NO')
a = 'keyence'
s = input()
S = len(s)
c = 0
i = 0
while i < S:
    if s[i] == a[c]:
        c += 1
    i += 1
if c == 7:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

a = 'keyence'
s = input()
S = len(s)
if s[:7] == 'keyence':
    print('YES')
elif s[:6] == 'keyenc' and s[-1] == 'e':
    print('YES')
elif s[:5] == 'keyen' and s[-2:] == 'ce':
    print('YES')
elif s[:4] == 'keye' and s[-3:] == 'nce':
    print('YES')
elif s[:3] == 'key' and s[-4:] == 'ence':
    print('YES')
elif s[:2] == 'ke' and s[-5:] == 'yence':
    print('YES')
elif s[0] == 'k' and s[-6:] == 'eyence':
    print('YES')
elif s[-7:] == 'keyence':
    print('YES')
else:
    print('NO')
import math

short = int(input())
long = int(input())
hour = int(input())
min = int(input())

hour = 360 / 12 * hour + 360/12/60*min
min = 360 / 60 * min

rasian = abs(hour - min)

if rasian > 90:
    length = math.sqrt(short*short + long*long + 2*short*long*math.cos(math.radians(rasian)))
elif rasian < 90:
    length = math.sqrt(short*short + long*long - 2*short*long*math.cos(math.radians(rasian)))
else:
    length = math.sqrt(short*short + long*long)
print(length)

### FIXED CODE ###

import math

short,long,hour,min=map(int,input().split())
hour = 360 / 12 * hour + 360/12/60*min
min = 360 / 60 * min

rasian = abs(hour - min)

length = math.sqrt(short*short + long*long - 2*short*long*math.cos(math.radians(rasian)))

print(length)
class Solution:
    def solve(self, a: int, b: int) -> int:

        return a * b // math.gcd(a, b)


if __name__ == '__main__':

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

    # solve
    solution = Solution()
    print(solution.solve(a, b))


### FIXED CODE ###

import fractions


class Solution:
    def solve(self, a: int, b: int) -> int:

        return a * b // fractions.gcd(a, b)


if __name__ == '__main__':

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

    # solve
    solution = Solution()
    print(solution.solve(a, b))
n, m = map(int, input().split())
adjacent_list = [[] for i in range(n + 1)]
for i in range(m):
    x, y, z = map(int,input().split())
    adjacent_list[x].append(y)
    adjacent_list[y].append(x)
##結局、グラフが何個あるか数える
finished = set()
ans = 0
def dfs(node):
    global finished
    finished.add(node)
    for i in adjacent_list[node]:
        if i not in finished:
            dfs(i)

while len(finished) != n:
    for i in range(1,n+1):
        if i not in finished:
            dfs(i)
            ans += 1
        
print(ans)




### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n, m = map(int, input().split())
adjacent_list = [[] for i in range(n + 1)]
for i in range(m):
    x, y, z = map(int,input().split())
    adjacent_list[x].append(y)
    adjacent_list[y].append(x)
##結局、グラフが何個あるか数える
finished = set()
ans = 0
def dfs(node):
    global finished
    finished.add(node)
    for i in adjacent_list[node]:
        if i not in finished:
            dfs(i)

while len(finished) != n:
    for i in range(1,n+1):
        if i not in finished:
            dfs(i)
            ans += 1
print(ans)
N,Z,W = map(int,input().split(" "))
a = list(map(int,input().split(" "))
print(abs(a[-1]-W))

### FIXED CODE ###

# D問題

N,Z,W =  map(int,input().split(" "))

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

if N == 1:
	ans = abs(a[-1]-W)
else:
	ans = max(abs(a[-1]-a[-2]),abs(a[-1]-W))


print(ans)
N = int(input())
K = int(input())

now = 1
for i in range(N):
	if(now >= K):
		now *= 2
    else:
		now+=K
print(now)


### FIXED CODE ###

N = int(input())
K = int(input())

now = 1
for i in range(N):
    if now <= K:
        now *= 2
    else:
        now+=K
print(now)
s = input()
k = int(input())

if len(s) == 1:
    print(s)
    import sys
    sys.exit()

rank = []
for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        ss = s[i:j]
        print(ss)
        if ss not in rank:
            if len(rank) < k:
                rank.append(ss)
            else:
                # print(ss)
                if ss <= rank[-1]:
                    rank.pop()
                    rank.append(ss)
                    rank = sorted(rank)
                    # print(rank)

print(rank[-1])


### FIXED CODE ###

s = input()
k = int(input())



rank = []
for i in range(len(s)):
    for j in range(i+1, min(i+6,len(s)+1)):
        ss = s[i:j]
        rank.append(ss)

rank = sorted(list(set(rank)))
print(rank[k-1])
n = int(input())
used = list(input() for x in range(n))
ans = "Yes"
for i in range(n): 
  if used.count(used[i]) == 2:
    ans = "No"
    break
  if used[i][-1] != used[i+1][0]:
    ans = "No"
print(ans)

### FIXED CODE ###

n = int(input())
used = list(input() for x in range(n))
ans = "Yes"
for i in range(n-1): 
  if used.count(used[i]) == 2:
    ans = "No"
    break
  if used[i][-1] != used[i+1][0]:
    ans = "No"
print(ans)
while 1:
    i = input()
    if not i:
        break

    print(len(str(sum(map(int, i.split())))))

### FIXED CODE ###

try:
    while 1:
        print(len(str(sum(map(int, input().split())))))
except Exception:
    pass
from bisect import bisect_left as bl

n, m, q = map(int, input().split())
lst = [i for i in range(n)]
alst = list(map(int, input().split()))
ind = 0
for a in alst:
  if a % 2 == 0:
    ind += a
  else:
    ind -= a
  ind = ind % len(lst)
  lst.pop(ind)
  ind = ind % len(lst)

qlst = list(map(int, input().split()))
for q in qlst:
  print(int(lst[bl(lst, q)] == q))


### FIXED CODE ###

from bisect import bisect_left as bl

n, m, q = map(int, input().split())
lst = [i for i in range(n)]
alst = list(map(int, input().split()))
ind = 0
for a in alst:
  if a % 2 == 0:
    ind += a
  else:
    ind -= a
  ind = ind % len(lst)
  lst.pop(ind)
  ind = ind % len(lst)

qlst = list(map(int, input().split()))
for q in qlst:
  print(int(q in lst))
import numpy as np

n = int(input())
a = np.array(input().split(), dtype=np.int)
mod = 10**9 + 7

pf = np.zeros((n, a.max()//2), dtype=np.int)
for i in range(n):
  while a[i] % 2 == 0:
    a[i] //= 2
    pf[0] += 1
  d = 3
  while d <= np.int(np.sqrt(a[i])):
    while a[i] % d == 0:
      a[i] //= d
      pf[d//2] += 1
    d += 2
  if a[i] > 1:
    pf[a[i]//2] += 1
    
b_pf = pf.max(axis=0) - pf
b_sum = 0
for i in range(n):
  b_sum += 2 ** b_pf[0] + np.arange(3, 2*pf.shape[1]+2, 2) ** b_pf[1:]
  b_sum %= mod
print(b_sum)

### FIXED CODE ###

from fractions import gcd

n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

lcm = 1
for i in range(n):
  lcm = lcm * a[i] // gcd(lcm, a[i])
lcm %= mod

sum_b = 0
for i in range(n):
  sum_b = (sum_b + lcm * pow(a[i], mod - 2, mod)) % mod
print(sum_b)
import sys

def main():
    N = input()
    A = input()
    x = N % 500
    if x%A==0:
        print('Yes')
    else:
        print('No')

main()

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = int(input())
    x = N % 500
    if x<=A:
        print('Yes')
    else:
        print('No')

main()
alp = input()
if str.isupper(alp) == True:
  print("A")
else:
  pritn("a")

### FIXED CODE ###

alp = input()
if str.isupper(alp) == True:
  print('A')
else:
  print('a')
s = input()
list_S = ["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"]
for i in list_s:
  if list_s[i] == s:
    print(list_s[i+1])
   

### FIXED CODE ###

s = input()
list_s = list(range(97, 97+26))
for i in range(26):
    if ord(s) == list_s[i]:
        print(chr(list_s[i+1]))
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
A = li()

yen = 1000
kabu = 0

for i in range(1, N):
    if A[i] > A[i-1]:
        kabu = (yen//A[i-1])
        yen = kabu * A[i] + (yen - kabu * A[i-1])

print(yen)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N, K = mi()
A = li()


for i in range(K, N):
    if A[i] > A[i-K]:
        print('Yes')
    else:
        print('No')
N = int(input())
V = input().split()
C = input().split()
i = int(0)
value = int(0)
if i < N:
    if V[i] - C[i] > 0:
        value = value + V[i] - C[i]
        i += 1
print(value)

### FIXED CODE ###

N = int(input())
V = input().split()
C = input().split()
value = int(0)
i = int(0)
for i in range(N):
    if int(V[i]) > int(C[i]):
        add = int(V[i]) - int(C[i])
        value = value + add
    i = i + 1
print(value)
A = int(input())
B = int(input())
if B % A == 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)