Harryxun/stf_run huggingface dataset:
ABCD = str(input())
A = ABCD[0]
B = ABCD[1]
C = ABCD[2]
D = ABCD[3]

if int(A) + int(B) + int(C) + int(D) == 7:
    print(A + "+" + B + "+" + C + "+" + D +"=7")
    break
if int(A) - int(B) + int(C) + int(D) == 7:
    print(A + "-" + B + "+" + C + "+" + D +"=7")
    break
if int(A) + int(B) - int(C) + int(D) == 7:
    print(A + "+" + B + "-" + C + "+" + D +"=7")
    break
if int(A) - int(B) - int(C) + int(D) == 7:
    print(A + "-" + B + "-" + C + "+" + D +"=7")
    break
if int(A) + int(B) + int(C) - int(D) == 7:
    print(A + "+" + B + "+" + C + "-" + D +"=7")
    break
if int(A) - int(B) + int(C) - int(D) == 7:
    print(A + "-" + B + "+" + C + "-" + D +"=7")
    break
if int(A) + int(B) - int(C) - int(D) == 7:
    print(A + "+" + B + "-" + C + "-" + D +"=7")
    break
if int(A) - int(B) - int(C) - int(D) == 7:
    print(A + "-" + B + "-" + C + "-" + D +"=7")
    break


### FIXED CODE ###


ABCD = str(input())
A = ABCD[0]
B = ABCD[1]
C = ABCD[2]
D = ABCD[3]

for i in range(1):
    if int(A) + int(B) + int(C) + int(D) == 7:
        print(A + "+" + B + "+" + C + "+" + D +"=7")
        break
    if int(A) - int(B) + int(C) + int(D) == 7:
        print(A + "-" + B + "+" + C + "+" + D +"=7")
        break
    if int(A) + int(B) - int(C) + int(D) == 7:
        print(A + "+" + B + "-" + C + "+" + D +"=7")
        break
    if int(A) - int(B) - int(C) + int(D) == 7:
        print(A + "-" + B + "-" + C + "+" + D +"=7")
        break
    if int(A) + int(B) + int(C) - int(D) == 7:
        print(A + "+" + B + "+" + C + "-" + D +"=7")
        break
    if int(A) - int(B) + int(C) - int(D) == 7:
        print(A + "-" + B + "+" + C + "-" + D +"=7")
        break
    if int(A) + int(B) - int(C) - int(D) == 7:
        print(A + "+" + B + "-" + C + "-" + D +"=7")
        break
    if int(A) - int(B) - int(C) - int(D) == 7:
        print(A + "-" + B + "-" + C + "-" + D +"=7")
        break
a, b, c, k = map(int, input().split())

num_list = [1] * a + [0] * b + [-1] * c

count = sum(num_list[:k])
print(count)

### FIXED CODE ###

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

count = 0
if a < k:
    count += a
    if a+b < k:
        count -= k-a-b
else:
    count = k

print(count)
a = []
al, ar = 1, n
for _ in xrange(m):
    l, r = [int(x) for x in raw_input().split()]
    a.append((l, r))
a.sort()
for (l, r) in a:
    al = max(l, al)
    ar = min(r, ar)
ans = max(ar - al + 1, 0)
print ans


### FIXED CODE ###

n, m = [int(x) for x in raw_input().split()]
a = []
al, ar = 1, n
for _ in xrange(m):
    l, r = [int(x) for x in raw_input().split()]
    a.append((l, r))
a.sort()
for (l, r) in a:
    al = max(l, al)
    ar = min(r, ar)
ans = max(ar - al + 1, 0)
print ans
N= int(input('N='))
A= int(input('A='))
B= int(input('B='))
C= N*A
if C>B:
  print (B)
else: 
  print (C)

### FIXED CODE ###

N,A,B=map(int,input().split())
if N*A >=B:
  print (B)
else:
  print(N*A)
import numpy as np
from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse import csr_matrix
N = int(input())
L = np.full((N, N), np.inf)
for i in range(N-1):
  a, b, c = map(int, input().split())
  L[a-1][b-1] = c
  L[b-1][a-1] = c
L = csr_matrix(L)
L = floyd_warshall(L, 0)
print (L)
Q, K = map(int, input().split())
K -= 1
for i in range(Q):
  x, y = map(int, input().split())
  x -= 1
  y -= 1
  print (int(L[x][K] + L[K][y]))

### FIXED CODE ###

from collections import defaultdict as dd
from collections import deque
N = int(input())
D =dd(list)
for i in range(N-1):
  a, b, c = map(int, input().split())
  D[a-1].append((b-1, c))
  D[b-1].append((a-1, c))

Q, K = map(int, input().split())
K -= 1
L = [0 for _ in range(N)]
q = deque([])
q.append(K)
while len(q) > 0:
  a = q.pop()
  for b, c in D[a]:
    if L[b] == 0:
      L[b] = L[a] + c
      q.append(b)

for i in range(Q):
  x, y = map(int, input().split())
  print (L[x-1] + L[y-1])
import math
a = int(input())
print(2**math.floor(math.log2(a)))

### FIXED CODE ###

import math
a = int(input())
print(2**math.floor(math.log(a,2)))
word = input()
start = 0
end = len(word)
while(True):
	i = word.find('?', start, end)
	if (i == -1):
		break
	elif ((i == (end-1)):
		word = word.replace('?', "D", 1)   
    elif (word[i-1] == 'P')):
		word = word.replace('?', "D", 1)
	elif ((word[i+1] == "?") or (word[i+1] == "D")):
		word = word.replace('?', "P", 1)
	start = i + 1
print(word)

### FIXED CODE ###

word = input()
start = 0
end = len(word)
while(True):
	i = word.find('?', start, end)
	if (i == -1):
		break
	elif (i == (end-1)):
		word = word.replace('?', "D", 1)   
	elif (word[i-1] == 'P'):
		word = word.replace('?', "D", 1)
	elif ((word[i+1] == "?") or (word[i+1] == "D")):
		word = word.replace('?', "P", 1)
	else:
		word = word.replace('?', "D", 1)
	start = i + 1
print(word)
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=[1,3,5,7,8,10,12]
    b=[4,6,9,11]
    c=[2]
    x,y = INTM()
    if x in a:
        d = 21
    elif x in b:
        d = 22
    elif x==2:
        d = 23
    
    if y in a:
        f = 21
    elif x in b:
        f = 22
    elif y==2:
        f = 23
    
    if d==f:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

### FIXED CODE ###

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a=[1,3,5,7,8,10,12]
    b=[4,6,9,11]
    c=[2]
    x,y = INTM()
    if x in a:
        d = 21
    elif x in b:
        d = 22
    elif x==2:
        d = 23
    
    if y in a:
        f = 21
    elif y in b:
        f = 22
    elif y==2:
        f = 23
    
    if d==f:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()
n, q = map(int, input().split())
s = list(input())
quiz = [list(map(int, input().split())) for _ in range(q)]

cnt_list = [0]*n
jufge = 0

for i in range(n):
    if s[i] == "A":
        judge = 1
        cnt_list[i] = cnt_list[i-1]
    elif judge == 1 and s[i] == "C":
        judge = 0
        cnt_list[i] = cnt_list[i-1] + 1
    else:
        cnt_list[i] = cnt_list[i-1]

for i in range(n):
    print(cnt_list[quiz[i][1] - 1] - cnt_list[quiz[i][0]-1])

### FIXED CODE ###

n, q = map(int, input().split())
s = list(input())
quiz = [list(map(int, input().split())) for _ in range(q)]

cnt_list = [0]*n
judge = 0

for i in range(n):
    if s[i] == "A":
        judge = 1
        cnt_list[i] = cnt_list[i-1]
    elif judge == 1 and s[i] == "C":
        judge = 0
        cnt_list[i] = cnt_list[i-1] + 1
    else:
        judge = 0
        cnt_list[i] = cnt_list[i-1]

for i in range(q):
    print(cnt_list[quiz[i][1] - 1] - cnt_list[quiz[i][0]-1])
A, B = int(input())

print(max(A+B, A-B, A*B))

### FIXED CODE ###

A, B = map(int, input().split())
 
print(max(A+B, A-B, A*B))
a,b = map(int,input(),split())
print(a * b,(a + b) * 2)




### FIXED CODE ###


a,b =(int(x) for x in input().split())
print(a * b, (a+b) * 2)
content = input().split()
abbrev = [letter[0] for letter in content if letter[0].isupper() ]
abbrev = "".join(abbrev)
print(abbrev)

### FIXED CODE ###

str_words = raw_input()
after_split = ''.join([each_str[0] for each_str in str_words.split()])
print(after_split)
X = int(input())
li = []
for i in range(1, X+1):
    for j in range(2, X+1):
        if X >= i**j:
            li.append(i**j)
print(max(li))


### FIXED CODE ###

X = int(input())

result = 1
for b in range(1, 32):
    for p in range(2, X+1):
        if X >= b**p:
            result = max(result, b ** p)
print(result)
while True:
    n=raw_input()
    if n in "0":break
    m=input()
    S,L=set(),[]
    for i in range(m):
        a,b=map(int,raw_input().split())
        if a==1:
            S.add(b)
        elif b==1:
            S.add(a)
        else:
            L.append((a,b))
    for i in S:
        for s in L:
            if i in s:
                S=S.union(s)
    print len(S)

### FIXED CODE ###

while True:
    n=raw_input()
    if n in "0":break
    try:
        m=input()
    except SyntaxError:
        break
    S,L=set(),[]
    for i in range(m):
        a,b=map(int,raw_input().split())
        if a==1:
            S.add(b)
        elif b==1:
            S.add(a)
        else:
            L.append((a,b))
    for i in S:
        for s in L:
            if i in s:
                S=S.union(s)
    print len(S)
S = input()
T = input()

for i in range(len(S) - len(T)):
    count = 0
    maxcount = 0
    for j in range(len(T)):
        if S[i + j] == T[j]:
            count += 1
        maxcount = max(maxcount, count)
print(len(T) - maxcount)


### FIXED CODE ###

S = input()
T = input()

maxcount = 0
for i in range(len(S) - len(T)+1):
    count = 0
    for j in range(len(T)):
        if S[i + j] == T[j]:
            count += 1
        maxcount = max(maxcount, count)
print(len(T) - maxcount)
N = int(input())
An = list(map(int, input().split()))
for n in range(N):
    An[n] -= (n+1)

An.sort()

m = N-1
if (m % 2 == 0):
    cent = (An[m//2] + An[m//2 + 1]) // 2
else:
    cent = An[(m+1)//2]

ans = sum(An) - N * cent

print(ans)



### FIXED CODE ###

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

for n in range(N):
    An[n] -= (n+1)

An.sort()

if (N-1) % 2 != 0:
    m = N//2 - 1
else:
    m = (N-1)//2

bf = -sum(An[0:m+1:]) + (m+1)*An[m]
af = sum(An[m+1::]) - (N-m-1)*An[m]
ans = bf + af
print(ans)
a,b,n=map(int,input().split())
C = set(set([a:min(a+n,b)])|set([max(a,b-n):b]))
for i in C:
  print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())
if b-a+1>k*2:
  for i in range(a,a+k):
    print(i)
  for j in range(b-k+1,b+1):
    print(j)
else:
  for h in range(a,b+1):
    print(h)
import numpy as np
goukei = 0

N = int(input()) * (-1)
Ai = list(map(int, input().split()))
array_Ai = np.array(Ai)
for i in range(len(Ai)):
    number = np.array([j + i for j in range(0, N, -1)])
    new_ai = number + array_Ai
    goukei += np.count_nonzero(new_ai == -Ai[i])
print(goukei)

### FIXED CODE ###

import collections
goukei = 0

N = int(input())
Ai = list(map(int, input().split()))
number = [j for j in range(1, N+1, 1)]
plus_Ai = [x + y for (x, y) in zip(Ai, number)]
minus_Ai = [x - y for (y, x) in zip(Ai, number)]
c = collections.Counter(plus_Ai)

for i in minus_Ai:
    goukei += c[i]
print(goukei)
s = input()
  N = len(s)
  ans = 0

  tmp = ""
  i = 0
  while i < N:
if not tmp == s[i]:
tmp = s[i]
            ans += 1
  else:
tmp = ""
  i += 1
  if not i == N:
ans += 1
  i += 1
  # print(tmp, ans, i)

  print(ans)

### FIXED CODE ###

def main():
    s = input()
    N = len(s)
    ans = 0

    tmp = ""
    i = 0
    while i < N:
        if not tmp == s[i]:
            tmp = s[i]
            ans += 1
        else:
            tmp = ""
            i += 1
            if not i == N:
                 ans += 1
        i += 1
        # print(tmp, ans, i)

    print(ans)
    return


if __name__ == "__main__":
    main()
from __future__ import print_function
import numpy as np
import sys

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

cnt=0
S=list(input())
# eprint(S)

L=list()
L.append(S.pop())
while len(S):
    if S[-1]==L[-1]: # SのfrontとLのfrontが0と0とか一致しちゃった時だから，消せない．次のSのfrontを見よう 
        L.append(S.pop())
        # eprint("S: " + str(S))
        # eprint("L: " + str(L))
    else: # SのfrontとLのfrontが0と1となっている場合．消す．
        S.pop()
        L.pop()
        if L==[]:
            L.append(S.pop())
        cnt=cnt+2
        # eprint("S: " + str(S))
        # eprint("L: " + str(L))

print(cnt)

#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#


### FIXED CODE ###

from __future__ import print_function
import numpy as np
import sys

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

cnt=0
S=list(input())
# eprint(S)

L=list()
L.append(S.pop())
while len(S)!=0:
    if S[-1]==L[-1]: # SのfrontとLのfrontが0と0とか一致しちゃった時だから，消せない．次のSのfrontを見よう 
        L.append(S.pop())
        # eprint("S: " + str(S))
        # eprint("L: " + str(L))
    else: # SのfrontとLのfrontが0と1となっている場合．消す．
        S.pop()
        L.pop()
        if L==[] and S!=[]:
            L.append(S.pop())
        cnt=cnt+2
        # eprint("S: " + str(S))
        # eprint("L: " + str(L))

print(cnt)

#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
n = int(input())
sp = []
for i in range(n):
    s,t = map(str,input().split())
    sp.append([s,-t,i+1])

sp.sort()
for i in range(n):
    print(sp[i][2])

### FIXED CODE ###

n = int(input())
sp = []
for i in range(n):
    s,t = map(str,input().split())
    t = int(t)
    sp.append([s,-t,i+1])

sp.sort()
for i in range(n):
    print(sp[i][2])
X, Y, Z, K  = list(map(int, input().split()))
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

l = []
for a in A:
    for b in B:
        l.append(a+b)
l = sorted(l, reverse = True)[:K]

ans = []
for c in C:
    for k in l:
        ans.append(c + k)
        
ans = sorted(ans, reverse = True)
print(*ans[:K], seq="\n")

### FIXED CODE ###

X, Y, Z, K  = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

l = []
for a in A:
    for b in B:
        l.append(a+b)
l = sorted(l, reverse = True)[:K]

ans = []
for c in C:
    for k in l:
        ans.append(c + k)
        
ans = sorted(ans, reverse = True)
print(*ans[:K], sep="\n")
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)

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


for i in range(N):
        hoge = A[i]
        A[i] = A[i-1]
        if gcd(A) >= output:
                output = gcd(A)
        A[i]=hoge

print(output)

### FIXED CODE ###

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

N = int(input())
A= list(map(int,input().split()))
output=0
KA=[0 for i in range(N)]
LA=[0 for i in range(N)]
GCD = []

for k in range(1,N):
        LA[k]=gcd(A[k-1],LA[k-1])

for k in range(1,N):
        KA[k]=gcd(A[N-k],KA[k-1])


for k in range(N):
        GCD.append(gcd(LA[k],KA[N-k-1]))
output = max(GCD)
print(output)
H,W,s=list(map(int,input().split()))
l=[list(input()) for i in range(H)]
l_h=[0]*H
for i in range(H):
   if "#" in set(l[i]):
      l_h[i]=1
cnt=0
bor=sum(l_h)-1
for i in range(H):
   if l_h[i]==1:
      l_h[i]=-1
      cnt+=1
   if cnt==bor:
      break
cnt=1
import numpy as np
tmp=[]
st=0
ans=np.zeros((H,W))
for i in range(H):
   tmp.append(l[i])
   if l_h[i]==-1:
      n_tmp=np.array(tmp)
      s_count=np.count_nonzero(n_tmp=="#")-1
      for j in range(W):
         ans[st:i+1,j]=cnt
         if "#" in n_tmp[:,j] and s_count>0:
            cnt+=1
            s_count-=1
      st=i+1
      cnt+=1
      tmp=[]
n_tmp=np.array(tmp)
s_count=np.count_nonzero(n_tmp=="#")-1
for j in range(W):
   ans[st:i+1,j]=cnt
   if "#" in n_tmp[:,j] and s_count>0:
      cnt+=1
      s_count-=1
for i in ans:
   print(*list(map(int,i)))

### FIXED CODE ###

H,W,s=list(map(int,input().split()))
l=[list(input()) for i in range(H)]
l_h=[0]*H
for i in range(H):
   if "#" in set(l[i]):
      l_h[i]=1
cnt=0
bor=sum(l_h)-1
for i in range(H):
   if cnt==bor:
      break
   if l_h[i]==1:
      l_h[i]=-1
      cnt+=1
cnt=1
import numpy as np
tmp=[]
st=0
ans=np.zeros((H,W))
for i in range(H):
   tmp.append(l[i])
   if l_h[i]==-1:
      n_tmp=np.array(tmp)
      s_count=np.count_nonzero(n_tmp=="#")-1
      for j in range(W):
         ans[st:i+1,j]=cnt
         if "#" in n_tmp[:,j] and s_count>0:
            cnt+=1
            s_count-=1
      st=i+1
      cnt+=1
      tmp=[]
n_tmp=np.array(tmp)
s_count=np.count_nonzero(n_tmp=="#")-1
for j in range(W):
   ans[st:i+1,j]=cnt
   if "#" in n_tmp[:,j] and s_count>0:
      cnt+=1
      s_count-=1
for i in ans:
   print(*list(map(int,i)))
import sys
A = list(map(int, input().split()))
N = int(input())

if len(A) == len(set(A)):
    print("YES")
else:
    print("NO")


### FIXED CODE ###

s,t = input().split()
a,b = map(int,input().split())
u = input()
 
if u == s:
    print(a - 1, b)
else:
    print(a, b- 1)
def cnct(lint,lim):
    global list753
    global list357
    global list333
    lint1=str(lint)+"3"
    lint1int=int(lint1)
    if lint1int<=lim and not lint1int in list357:
        list357.add(lint1int)
        cnct(lint1int,lim)
    lint2=str(lint)+"5"
    lint2int=int(lint2)
    if lint2int<=lim and not lint2int in list357:
        list357.add(lint2int)
        cnct(lint2int,lim)
    lint3=str(lint)+"7"
    lint3int=int(lint3)
    if lint3int<=lim and not lint3int in list357:
        list357.add(lint3int)
        cnct(lint3int,lim) 
    lint4="3"+str(lint)
    lint4int=int(lint4)
    if lint4int<=lim and not lint4int in list357:
        list357.add(lint4int)
        cnct(lint4int,lim)
    lint5="5"+str(lint)
    lint5int=int(lint5)
    if lint5int<=lim and not lint5int in list357:
        list357.add(lint5int)
        cnct(lint5int,lim)
    lint6="7"+str(lint)
    lint6int=int(lint6)
    if lint6int<=lim and not lint6int in list357:
        list357.add(lint6int)
        cnct(lint6int,lim)
def D(lint):
    lista=list(str(lint))
    if lista.count("3") and lista.count("5") and lista.count("7"):
        return True
    else:
        return False

list753=[3,5,7]
list357=set()
k=int(input())
count=0
for b in list753:
    cnct(b,k)
list333=list(list357)
list333.sort()
for c in [x for x in list333]:
    if not D(c):
        list333.remove(c)
print(len(list333))

### FIXED CODE ###

class Number:
    def __init__(self,number,qty):
        self.qty=qty
        self.number=number

n,k=map(int,input().split())
listn=[]
for a in range(n):
    b,c=map(int,input().split())
    listn.append(Number(b,c))
listn.sort(key=lambda x:x.number)
count=k
for a in listn:
    if a.qty>=count:
        print(a.number)
        break
    else:
        count-=a.qty
import itertools
while True:
    n=input()
    k=input()
    if n==k==0:break
    L=[raw_input() for i in range(n)]
    S=set()
    for t in itertools.permutations(L,k):
        S.add("".join(t))
    print len(S)

### FIXED CODE ###

import itertools
while True:
    n=raw_input()
    if n=="0 0":break
    else:
        k=input()
    if k==0:break
    L=[raw_input() for i in range(int(n))]
    S=set()
    for t in itertools.permutations(L,k):
        S.add("".join(t))
    print len(S)
rgb=list(map(str,input().split()))
X=int(join(rgb))
ans = "Yes" if X%4==0 else "No"
print(ans)

### FIXED CODE ###

r,g,b=map(str,input().split())
X=int(r+g+b)
ans = "YES" if X%4==0 else "NO"
print(ans)
s = list(input())
n = len(s)
s_half = (n - 1)/2
s_3 = (n + 3)/ 2
if s == s[::-1]:
	if s_half == s_half[::-1]:
		if s_3 == s_3[::-1]:
			print('Yes')
print('No')

### FIXED CODE ###

s = input()
l = len(s)
if list(s) != list(reversed(s)):
    print('No')
    exit()
if list(s[:(l - 1) // 2]) != list(reversed(s[:(l - 1) // 2])):
    print('No')
    exit()
if list(s[(l + 3) // 2 -1:l]) != list(reversed(s[(l + 3) // 2 -1:l])):
    print('No')
    exit()
print('Yes')
A = []
for i in range(3):
    A.append(list(input().split()))
N = int(input())
B = set()
for i in range(N):
    B.append(input())
if {A[0]} <= B or {A[1]} <= B or {A[2]} <= B or {A[0][0], A[1][0], A[2][0]} <= B, {A[0][1], A[1][1], A[2][1]} <= B or //
{A[0][2], A[1][2], A[2][2]} <= B or {A[0][0], A[1][1], A[2][2]} <= B or {A[2][2], A[1][1], A[2][0]} <= B:
print("Yes")
else:
    print("No")

### FIXED CODE ###

A = []
for i in range(3):
    A.append(list(input().split()))
N = int(input())
B = []
for i in range(N):
    B.append(input())
B=set(B)
if set(A[0]) <= B or set(A[1]) <= B or set(A[2]) <= B or {A[0][0], A[1][0], A[2][0]} <= B or\
{A[0][1], A[1][1], A[2][1]} <= B or {A[0][2], A[1][2], A[2][2]} <= B \
or {A[0][0], A[1][1], A[2][2]} <= B or {A[0][2], A[1][1], A[2][0]} <= B:
    print("Yes")
else:
    print("No")
import numpy as np
n=int(input())
a= list(map(int, input().strip().split()))
a.sort()
b=1
for i in range(n):
    b*=a[i]
f=0#pairwise coprime
for i in range(n):
    if b%(a[i])**2==0:
        f=1
        break
b=np.gcd(a[0],a[1])
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
if f==0:
    print("pairwise coprime")

   

### FIXED CODE ###

d,t,s= list(map(int, input().strip().split()))
x=t*s
if x>=d:
    print("Yes")
else:
    print("No")
a = int(input())
b = int(input())
if 2800<=a and a<3200:
    print("red")
else if 3200 <= a and a <= 5000:
    print(b)


### FIXED CODE ###

a = int(input())
b = input()
if 2800 <= a and a<3200:
    print("red")
elif 3200 <=a and a <=5000:
    print(b)
import math
num = input().split(" ")
a = int(num[0])-1
b = int(num[1])
c = int(num[2])
d = int(num[3])
e = c * d // int(math.gcd(c, d))
aaa = b - (b//c) -(b//d) +(b//e) -(a -(a//c) -(a//d) + (a//e))
print(int(aaa))

### FIXED CODE ###

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

num = input().split(" ")
a = int(num[0])-1
b = int(num[1])
c = int(num[2])
d = int(num[3])
e = int(c * d / int(gcd(c, d)))
bb = b - (b//c) -(b//d) +(b//e) 
aa = a - (a//c) -(a//d) + (a//e)
print(int(bb-aa))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,Q = map(int,readline().split())
BIT = [0]*(N+1)

def BIT_query(idx):
    res_sum = 0
    while idx > 0:
        res_sum += BIT[idx]
        idx -= idx&(-idx)
    return res_sum

def BIT_update(idx,x):
    while idx <= N:
        BIT[idx] += x
        idx += idx&(-idx)
    return

c = [0]+list(map(int,input().split()))
lastAppeared = [-1]*(N+1)
ans = [0]*Q
queries = []
for q in range(Q):
    l,r = map(int,readline().split())
    queries.append(r*10**12+l*10**6+q)
queries.sort()

curR = 0
for i in range(Q):
    query = queries[i]
    r = query//10**12
    query %= 10**12
    l = query//10**6
    q = query % 10**6
    for R in range(curR+1,r+1):
        color = c[R]
        last = lastAppeared[color]
        if last != -1:
            BIT_update(last,-1)
        lastAppeared[color] = R
        BIT_update(R,1)
    ans[q] = BIT_query(r)-BIT_query(l-1)
for i in range(Q):
    print(ans[i])


### FIXED CODE ###

N,Q = map(int,input().split())
BIT = [0]*(N+1)

def BIT_query(idx):
    res_sum = 0
    while idx > 0:
        res_sum += BIT[idx]
        idx -= idx&(-idx)
    return res_sum

def BIT_update(idx,x):
    while idx <= N:
        BIT[idx] += x
        idx += idx&(-idx)
    return

c = [-1]+list(map(int,input().split()))
lastAppeared = [-1]*(N+1)
ans = [0]*Q
queries = []
for q in range(Q):
    l,r = map(int,input().split())
    queries.append((l,r,q))
queries.sort(key = lambda x:x[1])

curR = 0
for i in range(Q):
    l,r,q = queries[i]
    while curR < r:
        curR += 1
        new = c[curR]
        last = lastAppeared[new]
        if last != -1:
            BIT_update(last,-1)
        lastAppeared[new] = curR
        BIT_update(curR,1)
    ans[q] = BIT_query(r)-BIT_query(l-1)
for i in range(Q):
    print(ans[i])
import sys

while 1:
    line = sys.stdin.readline()
    if line is ' ':
        break
    a,b,c,d,e,f = map(float, input().split())  
    y=(c*d-a*f)/(b*d-a*e)
    x=(c-b*y)/a
    print("{0:.3f} {1:.3f}".format(x,y))


### FIXED CODE ###

while 1:
    try:
        a,b,c,d,e,f = map(float, input().split())  
        y=(c*d-a*f)/(b*d-a*e)
        x=(c-b*y)/a
        print("{0:.3f} {1:.3f}".format(x,y))
    except:
        break