Harryxun/stf_run huggingface dataset:
N,A= (int(i) for i in input().split())
a = N % 500
if (a > A):
	print("No")
    else
    print("Yes")

### FIXED CODE ###

N = int(input())
A = int(input())
if (N % 500 > A):
    print('No')
else:
    print('Yes')
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])
    
v,j=0,M

for i in range(N+1):
    if a[i]>K:
        break
    while b[j]>K-a[i]:
        j-=1
    v=max(b,i+j)

print(v)
       


### 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])
    
v,j=0,M

for i in range(N+1):
    if a[i]>K:
        break
    while b[j]>K-a[i]:
        j-=1
    v=max(v,i+j)

print(v)
N = int(raw_input())
list = map(int,raw_input().split())
list = np.sort(list)[::-1]
print list
list2 = np.array([1 if i % 2 == 0 else -1 for i in range(N)])
x = np.sum(list * list2)
print x

### FIXED CODE ###

N = int(raw_input())
A = int(raw_input())
div = N % 500
if div <= A:
    print 'Yes'
else:
    print 'No'
from math import sqrt, ceil, factorial
from collections import Counter

m = 10**9+7
def is_prime(n):
    if n == 1: return False
    if n == 2: return True
    for i in range(2, ceil(sqrt(n))+1):
        if n % i == 0: return False
    return True

def prime_factorization(n):
    if is_prime(n):return [n]
    factor = []
    f = 2
    while n > 1:
        if n % f == 0:
            factor.append(f)
            n /= f
        else:
            f += 1
    return factor

def comb(n, r):
    a = 1
    for i in range(n-r+1, n+1):
        a *= i
    return a//factorial(r)

N, M = map(int, input().split())
p = prime_factorization(M)
c = Counter(p)
ans = 1
for v in c.values():
    ans *= (comb(v + N - 1, v) % m)
print(ans%m)

### FIXED CODE ###

S = input()
T = input()
ans ='Yes'
d = {}
d2 = {}
for s, t in zip(S, T):

    if d.get(s) is not None:
        if d[s] != t:
            ans = 'No'
            break
    else:
        d[s] = t

    if d2.get(t) is not None:
        if d2[t] != s:
            ans = 'No'
            break
    else:
        d2[t] = s

print(ans)
s = string(input())
m = 753
a = 999

for i in range(len(s)-2):
  #print(s[i:i+3])
  if abs(m - int(s[i:i+3])) < a:
    a = abs(m - int(s[i:i+3]))
print(a)

### FIXED CODE ###

s = input()
m = 753
a = 999

for i in range(len(s)-2):
  #print(s[i:i+3])
  if abs(m - int(s[i:i+3])) < a:
    a = abs(m - int(s[i:i+3]))
print(a)
import itertools

N,M,X = map(int,input().split())
c = []
d = [0]*4
e = []
for _ in range(N):
  c.append(list(map(int,input().split())))
for r in range(1,N+1):
  for x in itertools.combinations(c,r):
    for y in range(len(x)):
      d[0] += x[y][0]
      d[1] += x[y][1]
      d[2] += x[y][2]
      d[3] += x[y][3]
    if d[1] < X or d[2] < X or d[3] < X:
      d = [0]*4
    else:
      e.append(d[0])
      d = [0]*4
if len(e)>0:
  print(min(e))
else:
  print(-1)

### FIXED CODE ###

import itertools

N,M,X = map(int,input().split())
c = []
d = [0]*(M+1)
e = []
for _ in range(N):
  c.append(list(map(int,input().split())))
for r in range(1,N+1):
  for x in itertools.combinations(c,r):
    for y in range(len(x)):
      for z in range(M+1):
        d[z] += x[y][z]
    for z in range(1,M+1):
      if d[z]<X:
        d = [0]*(M+1)
        break
      elif z == M:
        e.append(d[0])
        d = [0]*(M+1)
if len(e)>0:
  print(min(e))
else:
  print(-1)
K = int(input())
S = input()
if K >= len(S):
  print(S)
else:
  S = S[:K]+'...'
  print(S)


### FIXED CODE ###

N = int(input())
a = N%10
if a in [2,4,5,7,9]:
	print('hon')
elif a in [0,1,6,8]:
	print('pon')
elif a == 3:
	print('bon')
def f(exponent):
	#reurns how many times a prime raised to exponent can be used
	step = 1
	cumul = 0
	count = 0
	while( cumul <= exponent):
		cumul += step
		count +=1
		step +=1
	return count - (1 if cumul > exponent else 0)

def answer(n):
	if n == 1: return 0
	res = 0
	on = n
	for d in range(2, int(on ** 0.5) + 1)
		if n % d == 0:
			e = 0
			while(n%d == 0): e +=1
			res+= f(e)
		
	return res if n == 1 else 1

print answer(int(raw_input()))

### FIXED CODE ###

def f(exponent):
	#reurns how many times a prime raised to exponent can be used
	step = 1
	cumul = 0
	count = 0
	while( cumul <= exponent):
		cumul += step
		count +=1
		step +=1
	return count - (1 if cumul > exponent else 0)

def answer(n):
	if n == 1: return 0
	res = 0
	on = n
	p = True
	for d in range(2, int(on ** 0.5) + 2):
		if n % d == 0:
			p = False
			e = 0
			while(n%d == 0): 
				e +=1
				n/=d
			res+= f(e)
	if n > 1: res += 1
	return res

print answer(int(raw_input()))
def m()
  N=input()
  A=sorted(map(int,input().split()))
  M=A[-1]+1
  B=[0]*M
  for i in A:
    B[i]+=1
    if B[i]==1:
      for j in range(i*2,M,i):
        B[j]=2
  print(B.count(1))
m()

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
AM=max(A)+1
B=[0]*AM
x=0
for i in A:
  for j in range(i,AM,i):
    B[j]+=1
for i in A:
  if B[i]==1:
    x+=1
print(x)
N = int(input())
print(min([sum(list(map(int,input().split()))) for j in range(N)])

### FIXED CODE ###

N = int(input())
print(min([sum(list(map(int,input().split()))) for j in range(N)]))
from math import ceil
n,k=map(int,input().split())
a=list(map(int,input().split()))
if k==0:
    print(max(a))
    exit()
a.sort()
left,right=0,a[n-1]
mid=right
while abs(right-left)>2:
    mid=(left+right)/2
    temp=0
    for i in range(n-1,-1,-1):
        if a[i]<=mid: break
        temp+=a[i]//mid
    if temp>k: left=mid
    else: right=mid
mid=int(mid)-1
while True:
    temp=0
    flag=0
    for i in range(n-1,-1,-1):
        if a[i]<=mid: break
        temp+=a[i]//mid
    if temp>k: mid+=1
    else:
        flag=1
        break
    if flag: break
print(mid)

### FIXED CODE ###


n,k=map(int,input().split())
a=list(map(int,input().split()))
if k==0:
    print(max(a))
    exit()
a.sort()
left,right=0,a[n-1]
mid=right
while abs(right-left)>2:
    mid=(left+right)//2
    temp=0
    for i in range(n-1,-1,-1):
        if a[i]<=mid: break
        temp+=a[i]//mid
    if temp>k: left=mid
    else: right=mid
mid-=1
if mid<=0: mid=1
while True:
    temp=0
    flag=0
    for i in range(n-1,-1,-1):
        if a[i]<=mid: break
        temp+=a[i]//mid
    if temp>k: mid+=1
    else:
        flag=1
        break
    if flag: break
print(mid)
N = int (input())
if N < 10:
  print (N)
if N >=10 && N <100:
  print ("9")
if N >=100 && N < 1000:
  print (N - 99 + 9)
if N >= 1000 && N < 10000:
  print ("909")
if N >=10000 && N < 100000:
  print (N - 9999 + 900 + 9)
if N == 100000:
  print ("90909")

### FIXED CODE ###

N = int (input())
if N < 10:
  print (N)
elif N >=10 and N <100:
  print ("9")
elif N >=100 and N < 1000:
  print (N - 99 + 9)
elif N >= 1000 and N < 10000:
  print ("909")
elif N >=10000 and N < 100000:
  print (N - 9999 + 900 + 9)
elif N == 100000:
  print ("90909")
import numpy as np
N,S = map(int,input().split())
list = np.int32(input().split())
A = [[[0,0,0]for i in range(S+1)]for j in range(N+1)]
A[0][0][0] = 1
for i in range(N):
    for j in range(S+1):
        A[i+1][j][0] += A[i][j][0]
        A[i+1][j][0] %= 998244353
        A[i+1][j][1] += A[i][j][0] + A[i][j][1]
        A[i+1][j][1] %= 998244353
        A[i+1][j][2] += A[i][j][0] + A[i][j][1] + A[i][j][2]
        A[i+1][j][2] %= 998244353
        if list[i] + j <= S:
            A[i+1][list[i]+j][1] += A[i][j][0] + A[i][j][1]
            A[i+1][list[i]+j][1] %= 998244353
            A[i+1][list[i]+j][2] += A[i][j][0] + A[i][j][1]
            A[i+1][list[i]+j][2] %= 998244353
print(A[N][S][2] % 998244353) 

### FIXED CODE ###

N,M = map(int,input().split())
print(N*(N-1)//2+(M*(M-1))//2)
def f(s):
	p = True
	for u in s:
		if u not in ('RUD' if p else 'LUD'): return False
		p ^= True 
	returnTrue
print 'Yes' if f(raw_input()) else 'No'


### FIXED CODE ###

def f(s):
	p = True
	for u in s:
		if u not in ('RUD' if p else 'LUD'): return False
		p ^= True 
	return True
print 'Yes' if f(raw_input()) else 'No'
"""B - K-th Common Divisor"""
A,B,K=(int(i) for i in input().split())
result=[]
for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        result.append(i)
result.reverse()
print(result[K-1])

### FIXED CODE ###

A,B,C=(int(i) for i in input().split())
if A*C<=B:
  print(C)
else:
  print(int(B/A))
N = int(input())
a = list(map(int, input().split()))
r = sum(a)
ra = 0
result = 1e30
for i in tqdm(range(0,N)):
    ra += a[i]
    r -= a[i]
    result = min(result, abs(ra-r))
print(result)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
r = sum(a)
ra = 0
result = 1e30
for i in range(0,N):
    ra += a[i]
    r -= a[i]
    result = min(result, abs(ra-r))
print(int(result))
import copy

N, Q = map(int, input().split())
S = input()
ANSlist = [0]*Q
for i in range(Q):
    l ,r = map(int, input().split())
    SS = copy.copy(S)
    SS[l:r]
    for j in range(len(SS)):
        if SS[j] == "A" and SS[j+1] == "C":
            ANSlist[i] += 1
    
for i in range(len(ANSlist)):
    print(ANSlist[i])






### FIXED CODE ###

import copy

N, Q = map(int, input().split())
S = input()
t = [0]*(N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1]-t[l-1])
N=int(input())
H=list(map(int,input().split()))
count=0
H0=[]
for n in range(N-1):
    right=H[-(n+1)]
    left=H[-(n+2)]
    if left>=right:
        count+=1
        H0=[count]+H0
    else:
        count=0
        H0=[count]+H0

print(max(H0))

### FIXED CODE ###

N=int(input())
H=list(map(int,input().split()))
count=0
maxcount=0
for n in range(N-1):
    right=H[-(n+1)]
    left=H[-(n+2)]
    if left>=right:
        count+=1
    else:
        count=0
    if count>maxcount:
        maxcount=count

print(maxcount)
char = input()
if chara == 'A':
  print('T')
elif chara == 'T':
  print('A')
elif chara == 'C':
  print('G')
elif chara == 'G':
  print('C')

### FIXED CODE ###

chara = input()
if chara == 'A':
  print('T')
elif chara == 'T':
  print('A')
elif chara == 'C':
  print('G')
elif chara == 'G':
  print('C')
ans = 0
for i in range(n):
    for j in range(i,i+2):
        tmp = b[i]
        b[i] -= a[j]        
        if b[i]<=0:
            ans += tmp
            a[j] -= tmp
            break
        else:
            ans += a[j]
            a[j] = 0
            
print(ans)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    for j in range(i,i+2):
        tmp = b[i]
        b[i] -= a[j]        
        if b[i]<=0:
            ans += tmp
            a[j] -= tmp
            break
        else:
            ans += a[j]
            a[j] = 0
            
print(ans)
N = int(input())
L=[]
i = 0
s = 0
M2 = 0
for i in range (0,N):
    L.append(int(input()))
M = L[0]
for s in range(1,N):
    if  L[s] > M:
        M = L[s]
for s in range(1,N):
    if L[s] == M:
        continue
    else:
        if L[s] > M2:
            M2 = L[s]
for i in range(0,N):
    if L[i] == M:
        print(M2)
    else:
        print(M)
N = int(input())
L=[]
i = 0
s = 0
M2 = 0
for i in range (0,N):
    L.append(int(input()))
M = L[0]
for s in range(1,N):
    if  L[s] > M:
        M = L[s]
for s in range(1,N):
    if L[s] == M:
        continue
    else:
        if L[s] > M2:
            M2 = L[s]
for i in range(0,N):
    if L[i] == M:
        print(M2)
    else:
        print(M)


### FIXED CODE ###

N = int(input())
L=[]
i = 0
s = 0
M2 = 0
a = 0
for i in range (0,N):
    L.append(int(input()))
M = L[0]
for s in range(1,N):
    if  L[s] > M:
        M = L[s]
for s in range(0,N):
    if L[s] == M:
        a += 1
    else:
        if L[s] > M2:
            M2 = L[s]
for i in range(0,N):
    if L[i] == M and a < 2:
        print(M2)
    else:
        print(M)
N,M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in [0]*M]

class UnionFind:
    def __init__(self,N):
        self.Parent = [-1]*N
        self.size = [1]*N
    def get_Parent(self,n):
        if self.Parent[n] == -1:return n
        p = self.get_Parent(self.Parent[n])
        self.Parent[n] = p
        return p
    def get_size(self,n):
        p = self.get_Parent(n)
        return self.size[p]
    def merge(self,x,y):
        x = self.get_Parent(x)
        y = self.get_Parent(y)
        if x!=y:
            self.size[x] += self.size[y]
            self.Parent[y] = x
            return True
        return False
    def is_united(self,x,y):
        return self.get_Parent(x)==self.get_Parent(y)

ans = [0]
T = UnionFind(N)
for a,b in AB[::-1]:
    a-=1;b-=1
    ans.append(ans[-1])
    A = T.get_size(a)
    B = T.get_size(b)
    if T.merge(a,b):
        C = T.get_size(a)
        ans[-1] -= (A*(A-1)+B*(B-1))//2
        ans[-1] += (C*(C-1))//2

a0 = ans[-1]
for o in ans[-2::-1]:print(a0-o)

### FIXED CODE ###

N,M = map(int,input().split())
A = [0]*M
B = [0]*M
for i in range(M):
    A[i],B[i] = map(lambda x:int(x)-1,input().split())

def check_connect(A,B):
    a = cnt[A]
    b = cnt[B]
    if a==-1 and b==-1:
        connect.append([A,B])
        cnt[A] = len(connect)-1
        cnt[B] = cnt[A]
        return 1
    if a == b:
        return 0
    if a == -1:
        a,b,A,B = b,a,B,A
    if b==-1:
        connect[a] += [B]
        cnt[B] = a
        return len(connect[a])-1
        
    tmp1 = len(connect[a])
    tmp2 = len(connect[b])
    if tmp2 > tmp1:
        a,b = b,a
    connect[a] += connect[b]
    for i in connect[b]:
        cnt[i] = a
    tmp3 = tmp1+tmp2
    connect[b] = []
    return (tmp3*(tmp3-1)-tmp1*(tmp1-1)-tmp2*(tmp2-1))//2

connect = []
cnt = [-1]*N
dfubensa = [0]*M
for i in range(M-1,-1,-1):
    dfubensa[i] = check_connect(A[i],B[i])

fubensa = dfubensa[0]
print(fubensa)
for i in range(1,M):
    fubensa += dfubensa[i]
    print(fubensa)
n = list(map(int, input()))

n1 = n[0]
n2 = n[1]

if n1 < 10:
  print(n2 - (100*(10-n1)))
else:
  print(n2)

### FIXED CODE ###

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

if n[0] < 10:
  a = 100*(10-n[0])
  print(n[1]+a)
else:
  print(n[1])
a = raw_input()
l = a.split()
A = l[0]
B = l[1]
ans = 0


for i in range(int(A),int(B)):
  C = list(str(i))
  if C[0] == C[4] and C[1] == C[3]:
    ans += 1
    
print(ans)

### FIXED CODE ###

a = raw_input()
b = raw_input()
c = raw_input()

A = list(a)
B = list(b)
C = list(c)

print(A[0]+B[1]+C[2])
N =int(input())
list ={"AC"=0, "WA"=0, "TLE"=0, "RE"=0 }

for i in range(s):
  words = input()
  list[words]+=1

print("AC x "+str(list["AC"]))
print("WA x "+str(list["WA"]))
print("TLE x "+str(list["TLE"]))
print("RE x "+str(list["RE"]))


### FIXED CODE ###

N =int(input())
list ={"AC":0, "WA":0, "TLE":0, "RE":0 }
 
for i in range(N):
  words = input()
  list[words]+=1
 
print("AC x "+str(list["AC"]))
print("WA x "+str(list["WA"]))
print("TLE x "+str(list["TLE"]))
print("RE x "+str(list["RE"]))
num = int(input())
each_num = list(map(int, input().split(" ")))

ans = []

i = 1
for k in range(1, num+1):
    ans.append(each_num.index(k) + 1)
print(*ans)



### FIXED CODE ###

a = int(input())

i = 1
odds = 0
while i <= a:
    if i % 2 == 1:
        odds = odds + 1
        i = i +1
    else:
        i = i + 1

print(odds/a)
s = input()
t = input()

for i in range(len(s) + 1):
  if s[i] == t[i]:
    print("Yes")
    break
  else:
    print("No")
    


### FIXED CODE ###

s = input()
t = input()

if s == t[:-1]:
  print("Yes")
else:
  print("No")
def gcd(n, m):
    if max(n,m) % min(n,m) == 0:
        return min(n,m)
    else:
        return gcd(max(n,m), max(n,m) - min(n,m) * (max(n,m)//min(n,m)))

def lcm(n, m):
    return n * m / gcd(n, m)


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))

time = 0
for i in range(0, n-1):
    if i == 0:
        time = t[0]
    time = lcm(time, t[i+1])

print(int(time))

### FIXED CODE ###

def gcd(n, m):
    if min(n, m) == 0:
        return max(n,m)
    else:
        return gcd(min(n,m), max(n,m) % min(n,m))

def lcm(n, m):
    return n * m // gcd(n, m)


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(time, t_sorted[i])

print(int(time))
N, M = input().split()
for _ in range(M):
    a, b = input().split()
for i in range(1, N+1):
    print(a.count("i")+b.count("i"))

### FIXED CODE ###

n, m = map(int, input().split())
a, b = [0]*m, [0]*m
for i in range(m):
    a[i], b[i] = map(int, input().split())
for j in range(1,n+1):
    print(a.count(j)+b.count(j))
N = int(input())
A = list(map(int, input().split()))

def saisho_ko_baisu(A,B):
    # A < B
    x = A*B
    r = B%A
    while r!=0:
        B = A
        A = r
        r = B%A
    return x//A

A.sort()
tmp = saisho_ko_baisu(A[0], A[1])
for i in range(2,N):
    if tmp % A[i] != 0:
        tmp = saisho_ko_baisu(min([tmp, A[i]]), max([tmp, A[i]]))
res = 0
for a in A:
    res += tmp//a

print(res % (10**9 + 7))


### FIXED CODE ###

from fractions import gcd

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

div = 10**9 + 7
lcm_num = lcm(a)
ans = [lcm_num//ai for ai in a]

print(sum(ans)%div)
N,Y = map(int, input().split())


a = -1
b = -1
c = -1

flag = 0

for i in range(N + 1):
    if flag == 1:
        break
    if  Y - 10000 * i  == 0 & i == N:
        a = i
        b = 0
        c = 0
        flag = 1

    #if Y - 10000 * i - 5000 * (N - i) <= 0:
    for j  in range(N-i,N+1):
        if Y - 10000 * i - 5000 * j  - 1000 * (N - i -j)<= 0:
            for k in range(N-i-j,N + 1):
                if Y - 10000 * i - 5000 * j - 1000 * k == 0:
                    a = i
                    b = j
                    c   = k
                    flag = 1
                    break


print(str(a) +' '+ str(b) +' '+ str(c))


### FIXED CODE ###

S = input()

S=S.replace('2017','2018')

print(S)
n, k, x, y = int(input.split()) for _ in range(4)
print(k * x + (n - k) * y)

### FIXED CODE ###

n,k,x,y=(int(input()) for i in range(4))
if n - k > 0:
  ans = k * x + (n - k) * y
else:
  ans = n * x
print(ans)
pqr=list(map(int,input().split()))
pqr.sorted()
print(pqr[0]+pqr[1])

### FIXED CODE ###

pqr=list(map(int,input().split()))
pqr.sort()
print(pqr[0]+pqr[1])
def main():
    s = input()
    x, y = map(int, input().split())
    if solve(s, x, y):
        print('Yes')
    else:
        print('No')

def solve(s, x, y):
    moves = split_moves(s)
    if not match(x - moves[0][0], moves[0][1:]):
        return False
    if not match(y, moves[1]):
        return False

    return True

def match(x, moves):
    s = sum(moves)
    if x > s:
        return False

    if (s - x) % 2 != 0:
        return False

    return knapsack((s - x) // 2, moves)

def knapsack(x, moves):
    if x == 0:
        return True
    if x < 0:
        return False
    if len(moves) == 0:
        return False

    if knapsack(x - moves[0], moves[1:]):
        return True

    if knapsack(x, moves[1:]):
        return True

    return False

def split_moves(s):
    moves = [[0], []]
    i = 0
    j = 0

    for c in s:
        if c == 'F':
            moves[i][-1] += 1
        else:
            i = 1 - i
            moves[i].append(0)

    return moves

main()


### FIXED CODE ###

def main():
    s = input()
    x, y = map(int, input().split())
    if solve(s, x, y):
        print('Yes')
    else:
        print('No')

def solve(s, x, y):
    moves = split_moves(s)
    if not match(x - moves[0][0], moves[0][1:]):
        return False
    if not match(y, moves[1]):
        return False

    return True

def match(x, moves):
    s = sum(moves)
    if x > s:
        return False

    if (s - x) % 2 != 0:
        return False

    return knapsack((s - x) // 2, moves)

def knapsack(x, moves):
    if x == 0:
        return True

    prev = set([0])
    for m in moves:
        curr = set(i + m for i in prev if i + m <= x)
        if x in curr:
            return True
        curr |= prev
        prev = curr
    return False

def split_moves(s):
    moves = [[0], []]
    i = 0

    for c in s:
        if c == 'F':
            moves[i][-1] += 1
        else:
            i = 1 - i
            moves[i].append(0)

    return moves

main()
N = int(input())
p = [int(x) for x in input().split()]

ans = 0
for i in range(N) :
    if p[i] == i+1 :
        p[i], p[i+1] = p[i+1], p[i]
        ans += 1

print(ans)


### FIXED CODE ###

N = int(input())
p = [int(x) for x in input().split()]

ans = 0
for i in range(N) :
    if p[i] == i+1 :
        if i == N-1 :
            p[i], p[i-1] = p[i-1], p[i]
            ans += 1
        else :
            p[i], p[i+1] = p[i+1], p[i]
            ans += 1

print(ans)
a = int(input())
if a-1000 >= 0:
  print "ABD"
else:
  print "ABC"

### FIXED CODE ###

a = int(input())
if a-1000 >= 0:
  print("ABD")
else:
  print("ABC")
import sys
N=int(input())
A=list(map(int,input().split()))
flag=True
for i in range(N):
    if A[i]%2==0:
        if A[i]%3!=0 or A[i]%5!=0:
            flag=False
if flag==True:
    print('APPROVED')
else:
    print('DENIED'

### FIXED CODE ###

import sys
N=int(input())
A=list(map(int,input().split()))
flag=True
for i in range(N):
    if A[i]%2==0:
        if A[i]%3!=0 and A[i]%5!=0:
            flag=False
if flag==True:
    print('APPROVED')
else:
    print('DENIED')
n = int(innput())
f = 4
s = 7
for i in range(30):
  f = f*i
  for j in range(30):
    s = s*j
    if n%s == 0 or n%f == 0 or n%(f+s)==0:
      print('Yes')
      quit()
   	if n < f+s:
      break
print('No')
      

### FIXED CODE ###

n = int(input())
for i in range(100):
  for j in range(100):
    if 4*i+7*j == n:
        print('Yes')
        exit(0)
print('No')
N = int(input())
if N = 10**5:
  print(90909)
elif 10**4 <= N < 10**5:
  print(N-9089)
elif 10**3 < N < 10**4:
  print(910)
elif 10**2 < N < 10**3:
  print(N-90)
elif 1 <= N < 10**2:
  print(N)


### FIXED CODE ###

N = int(input())
if N == 10**5:
  res = 90909
elif 10**4 <= N < 10**5:
  res = N-9090
elif 10**3 <= N < 10**4:
  res = 909
elif 10**2 <= N < 10**3:
  res = N-90
elif 10 <= N < 10**2:
  res = 9
elif 1 <= N < 10:
  res = N
print(res)
x, y = int(input().split())

a = x * y
b = x**2 + y**2
print("{} {}".format(a, b))

### FIXED CODE ###

x, y = input().split()

a = int(x) * int(y)
b = int(x)*2 + int(y)*2
print("{} {}".format(a, b))
a,b  = map(int, raw_input().split())
A = [map(int, raw_input().split()) for _ in x range(a)]
B = [input() for _ in x range(b)]
C = [sum([A[i][j] * B[j] for j in x range(b)]) for i in x range(a)]
for x in C:
    print x

### FIXED CODE ###

a,b  = map(int, raw_input().split())
A = [map(int, raw_input().split()) for _ in xrange(a)]
B = [input() for _ in xrange(b)]
C = [sum([A[i][j] * B[j] for j in xrange(b)]) for i in xrange(a)]
for x in C:
    print x
N,M = map(int,input().split( ))
loads = []
teams = [[i] for i in range(N)]
syozoku = {i:i for i in range(N)}
for _ in range(M):
    A,B = map(int,input().split( ))
    if syozoku[A-1] != syozoku[B-1]:
        hairu,nukeru = min(syozoku[A-1],syozoku[B-1]),max(syozoku[A-1],syozoku[B-1])
        team = teams.pop(nukeru)
        teams[hairu] += team
        for i in team:
            syozoku[i] = hairu
ans = len(teams) - 1
print(ans)

### FIXED CODE ###

N,M = map(int,input().split( ))
loads = []
teams = [[i] for i in range(N)]
syozoku = {i:i for i in range(N)}
for _ in range(M):
    A,B = map(int,input().split( ))
    if syozoku[A-1] != syozoku[B-1]:
        hairu,nukeru = min(syozoku[A-1],syozoku[B-1]),max(syozoku[A-1],syozoku[B-1])
        team = teams[nukeru]
        teams[nukeru] = []
        teams[hairu] += team
        for i in team:
            syozoku[i] = hairu

ans = -1
for team in teams:
    if len(team) != 0:
        ans += 1
print(ans)
import math
a, b = map(int,stdin.readline().split())
gcd = math.gcd(a,b)
print((a*b)//math.gcd(a,b))

### FIXED CODE ###

a, b = map(int,input().split())
for i in range(1,b+1):
  if (a*i) % b == 0:
    print(a*i)
    break