This is an interactive problem.

In the Wonderful Metropolis of the Future, there is no need in subway train drivers. Due to the technological progress, they were replaced by the Artificial Intelligence (AI). Unfortunately, one day the predictions of sci-fi writers came true: the AI rebelled and now there is an uncontrollable train in the subway. It can be dangerous! Your task is to find the train and stop the AI.

The subway of the Metropolis is one line (regular straight line with no self-intersections) with n stations, indexed consecutively from 1 to n. At each moment the train is at some station. You need to determine the index of this station, so that the train would be secured.

To find the train, dispatcher Sarah gave you a gadget that allows you to select arbitrary numbers l and r (l ≤ r), and then check, whether the train is located on a station with index between l and r, inclusive. Unfortunately, recharging of the gadget takes some time (and every time you use it as soon as possible), so between two applications of the gadget the train can move to any station that is at most k stations away. Formally, if the train was at the station x when the gadget was applied, then at the next application of the gadget the train can appear at any station y such that max(1, x - k) ≤ y ≤ min(n, x + k).

Note that AI is not aware that you are trying to catch the train, so it makes all moves according to its predefined plan.

After an examination of the gadget you found that it is very old and can hold no more than 4500 applications, after which it will break and your mission will be considered a failure.

Can you find the station with the train using no more than 4500 applications of the gadgets?

Input

The first line contains two integers n and k (1 ≤ n ≤ 10^{18}, 0 ≤ k ≤ 10) — the number of stations and the maximum number of stations the train can move between two applications of the gadget.

Interaction

You can apply the gadget at most 4500 times. In order to apply the gadget you need to print two space-separated integers l and r (1 ≤ l ≤ r ≤ n). You will then receive either string "Yes", if the train is between stations l and r, inclusive, or string "No" otherwise. If l = r and you received "Yes", then you found the train successfully, and your program must halt immediately.

Answer "Bad" instead of "Yes" or "No" means that you made an invalid query or made too many queries. Exit immediately after receiving "Bad" and you will see Wrong answer verdict. Otherwise you can get an arbitrary verdict because your solution will continue to read from a closed stream.

After printing a query do not forget to output end of line and flush the output. Otherwise you will get Idleness limit exceeded. To do this, use:

  * fflush(stdout) or cout.flush() in C++; 
  * System.out.flush() in Java; 
  * flush(output) in Pascal; 
  * stdout.flush() in Python; 
  * see documentation for other languages. 



Hacks

In order to hack, you should present a test in the following format.

The first line should contain three integers n, k and p (1 ≤ n ≤ 10^{18}, 0 ≤ k ≤ 10, 1 ≤ p ≤ n) — the number of stations, the maximum number of stations the train can move between two applications of the gadget and the initial position of the train, respectively.

Each of the next 4500 lines should contain a single integer x (1 ≤ x ≤ n) — the positions of the train after each query. Two consecutive positions (including the initial one) should not differ by more than k.

For example, the following lines are the first lines of the sample test.
    
    
      
    10 2 5  
    5  
    3  
    5  
    7  
    7  
    ...  
    

Example

Input

10 2

Yes

No

Yes

Yes


Output

3 5

3 3

3 4

5 5

Note

In the first sample, the train was initially at the station 5, after the first application of the gadget it did not move, after the second application it moved to the station 3, and after the third application moved again to the station 5.

Source: codeforces | Difficulty: HARD
Tags: Sorting

Probability


Solutions:
import sys
import random
random.seed()
(n, k) = [int(x) for x in input().split()]
sson = 8 * k + 1
ssoff = 4 * k + 1
l = 1
r = n
ss = True if r - l > sson else False
while True:
	if ss:
		al = l
		ar = (l + r) // 2
		print(al, ar)
		sys.stdout.flush()
		ans = input()
		if ans == 'Yes':
			if ar == al:
				break
			r = ar
		else:
			l = ar + 1
	else:
		ap = ap = random.randint(l, r)
		print(ap, ap)
		sys.stdout.flush()
		ans = input()
		if ans == 'Yes':
			break
		elif ans == 'Bad':
			break
	l = max(l - k, 1)
	r = min(r + k, n)
	if r - l > sson:
		ss = True
	if r - l <= ssoff:
		ss = False


import random
(n, k) = map(int, input().split())

def form_search(bounds):
	guess_left = (bounds[0] + bounds[1]) // 2
	guess_right = bounds[1]
	return [guess_left, guess_right, False]

def print_guess(guess):
	output = str(guess[0]) + ' ' + str(guess[1])
	print(output, flush=True)

def form_guess(bounds):
	r = random.randint(bounds[0], bounds[1])
	return [r, r, True]

def expand_bounds(bounds):
	left = max(1, bounds[0] - k)
	right = min(n, bounds[1] + k)
	return [left, right]
done = False
bounds = [1, n]
while not done:
	if bounds[1] - bounds[0] < 50:
		guess = form_guess(bounds)
		print_guess(guess)
	else:
		guess = form_search(bounds)
		print_guess(guess)
	resp = input()
	b_resp = False
	if resp == 'Yes':
		b_resp = True
		if guess[2]:
			break
	if resp == 'Bad':
		break
	if b_resp:
		bounds = guess
	elif not guess[2]:
		bounds = [bounds[0], guess[0]]
	bounds = expand_bounds(bounds)


import sys
import random
random.seed()
(n, k) = [int(x) for x in input().split()]
sson = 5 * k
ssoff = 5 * k
l = 1
r = n
ss = True if r - l > sson else False
while True:
	if ss:
		al = l
		ar = (l + r) // 2
		print(al, ar)
		sys.stdout.flush()
		ans = input()
		if ans == 'Yes':
			if ar == al:
				exit(0)
			r = ar
		else:
			l = ar + 1
		if r - l <= ssoff:
			ss = False
	else:
		al = ar = random.randint(l, r)
		print(al, ar)
		sys.stdout.flush()
		ans = input()
		if ans == 'Yes':
			exit(0)
		elif ans == 'Bad':
			exit(0)
		if r - l > sson:
			ss = True
	l = max(l - k, 1)
	r = min(r + k, n)


import random

def read_ints():
	return [int(v) for v in input().split()]

def main():
	(n, k) = read_ints()
	(l, r) = (1, n)
	shoot_range = 50
	while l <= r:
		if r - l < shoot_range:
			c = random.randint(l, r)
			print('{} {}'.format(c, c), flush=True)
			ans = input()
			if ans == 'Yes':
				return
			(l, r) = (max(1, l - k), min(n, r + k))
		else:
			m = (l + r) // 2
			print('{} {}'.format(l, m), flush=True)
			ans = input()
			if ans == 'Yes':
				r = m
			else:
				l = m + 1
			(l, r) = (max(1, l - k), min(n, r + k))
main()


from random import randint
import sys
(n, k) = [int(w) for w in input().split()]

def there(l, r):
	print(l, r)
	sys.stdout.flush()
	a = input()
	if a == 'Bad':
		sys.exit(0)
	else:
		return a == 'Yes'
(l, r) = (1, n)
while True:
	if r - l < 57:
		x = randint(l, r)
		if there(x, x):
			sys.exit(0)
	else:
		m = (l + r) // 2
		if there(l, m):
			r = m
		else:
			l = m + 1
	l = max(l - k, 1)
	r = min(r + k, n)


from random import randint
(n, k) = map(int, input().split())
MAX_TRIAL = 4500
(left, right, mid) = (1, n, max(1, n // 2))
inLeft = True
(guessing, guess) = (False, -1)
while True:
	if not guessing:
		if inLeft:
			print(left, mid)
		else:
			print(mid, right)
	else:
		print(guess, guess)
	response = input()
	if response == 'Yes':
		if guessing or (inLeft and left == mid) or (not inLeft and mid == right):
			break
		if inLeft:
			right = min(mid + k, n)
			left = max(left - k, 1)
		else:
			left = max(mid - k, 1)
			right = min(right + k, n)
			inLeft = False
	elif response == 'No':
		if guessing:
			left = max(left - k, 1)
			right = min(right + k, n)
		elif inLeft:
			left = max(mid + 1 - k, 1)
			right = min(right + k, n)
			inLeft = False
		else:
			right = min(mid - 1 + k, n)
			left = max(left - k, 1)
	elif response == 'Bad':
		break
	mid = (left + right) // 2
	if right - left <= max(4 * k + 4, 1):
		guessing = True
		guess = randint(left, right)
	else:
		guessing = False


import random
from sys import stdout
(n, k) = map(int, input().split())
a = 1
b = n
while True:
	while b - a > 4 * k:
		center = (a + b) // 2
		print(a, center)
		stdout.flush()
		result = input().strip()
		if result == 'Bad':
			exit(0)
		elif result == 'Yes':
			if a == center:
				exit(0)
			b = center
		else:
			a = center + 1
		a -= k
		b += k
		a = max(1, a)
		b = min(n, b)
	val = random.randint(a, b)
	print(val, val)
	stdout.flush()
	result = input().strip()
	if result in ['Yes', 'Bad']:
		exit(0)
	a -= k
	b += k
	a = max(1, a)
	b = min(n, b)


from sys import stdout
from random import randint
(n, k) = list(map(int, input().split()))
known_left = 1
known_right = n
for i in range(4500):
	size = known_right - known_left
	mid = (known_left + known_right) // 2
	possible_left = max(1, known_left - k)
	pml = min(n, mid + k)
	psl = pml - possible_left
	possible_right = min(n, known_right + k)
	pmr = max(1, mid - k)
	psr = possible_right - pmr
	possible_size = max(psl, psr)
	if possible_size < size - 1:
		print(known_left, mid)
		stdout.flush()
		res = input().strip()
		if res == 'Yes':
			if known_left == mid:
				exit()
			known_left = max(1, known_left - k)
			known_right = min(n, mid + k)
		elif res == 'No':
			known_left = max(1, mid - k)
			known_right = min(n, known_right + k)
		elif res == 'Bad':
			exit()
	else:
		koor = randint(known_left, known_right)
		print(koor, koor)
		stdout.flush()
		res = input().strip()
		if res == 'Yes':
			exit()
		else:
			known_left = max(1, known_left - k)
			known_right = min(n, known_right + k)


import sys, random
(n, k) = list(map(int, input().split()))
l = 1
r = n
b = True
while b:
	while r - l > k * 4 + 1:
		m = (l + r) // 2
		print(l, m)
		sys.stdout.flush()
		ans = input()
		if ans == 'Bad':
			sys.exit(0)
		if ans == 'Yes':
			r = min(n, m + k)
			l = max(1, l - k)
		else:
			r = min(n, r + k)
			l = max(1, m - k)
	rnd = random.randint(l, r)
	print(rnd, rnd)
	sys.stdout.flush()
	ans = input()
	if ans == 'Bad':
		sys.exit(0)
	if ans == 'Yes':
		sys.exit(0)
	else:
		r = min(n, r + k)
		l = max(1, l - k)


import random
from sys import stdout
flus = stdout.flush
(n, k) = map(int, input().split())
(l, r) = (1, n)
try1 = 50
while True:
	if r - l > try1:
		st = (l + r) // 2
		print(l, st)
		flus
		judge = input()
		if judge == 'Bad':
			exit()
		if judge == 'Yes':
			(l, r) = (max(1, l - k), min(n, st + k))
		else:
			(l, r) = (max(1, st - k), min(n, r + k))
	else:
		chk = random.randint(l, r)
		print(chk, chk)
		flus
		judge = input()
		if judge == 'Yes' or judge == 'Bad':
			exit()
		l = max(1, l - k)
		r = min(n, r + k)


import sys
import random
n = 0
k = 0

def question(left, right):
	if right - left <= 4 * k + 3:
		x = left + random.randint(0, right - left)
		print(x, x)
		sys.stdout.flush()
		s = input()
		if s != 'Yes':
			question(max(1, left - k), min(n, right + k))
	else:
		mid = left + int((right - left) / 2)
		print(left, mid)
		sys.stdout.flush()
		s = input()
		if s == 'Yes':
			question(max(1, left - k), min(n, mid + k))
		else:
			question(max(1, mid - k), min(n, right + k))
(n, k) = map(int, input().split(' '))
question(1, n)


(n, k) = map(int, input().split())
from sys import stdout

def guess(a, b):
	print(a, b)
	stdout.flush()
	retval = input()
	if retval == 'Bad':
		exit(0)
	if a == b and retval == 'Yes':
		exit(0)
	return retval == 'Yes'
import random
random.seed()
(l, r) = (1, n + 1)
while True:
	while r - l > 4 * k + 2:
		mid = (l + r) // 2
		if guess(l, mid - 1):
			l = max(1, l - k)
			r = min(n + 1, mid + k)
		else:
			l = max(1, mid - k)
			r = min(n + 1, r + k)
	probe = random.randint(l, r - 1)
	guess(probe, probe)
	l = max(1, l - k)
	r = min(n + 1, r + k)


import sys, random
(n, k) = map(int, input().split())
l = 1
r = n
count = 0
while True:
	if l + 200 < r:
		try1 = (l + r) // 2
		print(l, try1, flush=True)
		s = input()
		if s == 'Yes':
			r = min(try1 + 10, n)
			l = max(1, l - 10)
		else:
			l = max(1, try1 - 10)
			r = min(n, r + 10)
	else:
		guess = random.randint(l, r)
		print(guess, guess, flush=True)
		s = input()
		if s == 'Yes':
			sys.exit()
		l = max(1, l - 10)
		r = min(r + 10, n)
	count += 1


from random import randint
import sys

def ask(l, r):
	print(l, r)
	sys.stdout.flush()
	a = input()
	return a == 'Yes'
(n, k) = map(int, input().split())
(l, r) = (1, n)
while True:
	if r - l < 61:
		x = randint(l, r)
		if ask(x, x):
			exit(0)
	else:
		m = (l + r) // 2
		if ask(l, m):
			r = m
		else:
			l = m + 1
	(l, r) = (max(l - k, 1), min(r + k, n))