Buggy python submission (verdict: Time Limit Exceeded):
import sys
from sys import stdin
N = int(stdin.readline().rstrip())
print(0)
s = input()
cnt = 0
N = (N-1)//2
if s == "Male":
    for _ in range(25):
        print(N)
        #sys.stdout.write(N)
        sys.stdout.flush()
        s = input()
        if s == "Male" and N % 2 == 0:
            N += max(min(N//2,(L-N)//2),1)
        elif s == "Female" and N % 2 != 0:
            N += max(min(N//2,(L-N)//2),1)
        elif s == "Vacant":
            break
        else:
            N -= max(min(N//2,(L-N)//2),1)
        
elif s == "Female":
    for _ in range(25):
        print(N)
        #sys.stdout.write(N)
        sys.stdout.flush()
        s = input()
        if s == "Female" and N % 2 == 0:
            N += max(min(N//2,(L-N)//2),1)
        elif s == "Male" and N % 2 != 0:
            N += max(min(N//2,(L-N)//2),1)
        elif s == "Vacant":
            break
        else:
            N -= max(min(N//2,(L-N)//2),1)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
r = N-1
l = 0
print(0)
s = input()
cnt = 0
mid = (r+l)//2
if s == "Male":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Male" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Female" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2
        
elif s == "Female":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Female" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Male" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N = int(stdin.readline().rstrip())
print(0)
s = input()
cnt = 0
N = (N-1)//2
if s == "Male":
    for _ in range(25):
        print(N)
        s = input()
        if s == "Male" and N % 2 == 0:
            N += max(min(N//2,(L-N)//2),1)
        elif s == "Female" and N % 2 != 0:
            N += max(min(N//2,(L-N)//2),1)
        elif s == "Vacant":
            break
        else:
            N -= max(min(N//2,(L-N)//2),1)
        
elif s == "Female":
    for _ in range(25):
        print(N)
        s = input()
        if s == "Female" and N % 2 == 0:
            N += max(min(N//2,(L-N)//2),1)
        elif s == "Male" and N % 2 != 0:
            N += max(min(N//2,(L-N)//2),1)
        elif s == "Vacant":
            break
        else:
            N -= max(min(N//2,(L-N)//2),1)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
r = N-1
l = 0
print(0)
s = input()
cnt = 0
mid = (r+l)//2
if s == "Male":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Male" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Female" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2
        
elif s == "Female":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Female" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Male" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N = int(stdin.readline().rstrip())
print(0)
s = input()
cnt = 0
N = (N-1)//2
if s == "Male":
    while True:
        cnt += 1
        if cnt > 25:
            break
        print(N)
        s = input()
        if s == "Male" and N % 2 == 0:
            N += min(N//2,(L-N)//2)
        elif s == "Female" and N % 2 != 0:
            N += min(N//2,(L-N)//2)
        elif s == "Vacant":
            break
        else:
            N -= min(N//2,(L-N)//2)
        
elif s == "Female":
    while True:
        cnt += 1
        if cnt > 25:
            break
        print(N)
        s = input()
        if s == "Female" and N % 2 == 0:
            N += min(N//2,(L-N)//2)
        elif s == "Male" and N % 2 != 0:
            N += min(N//2,(L-N)//2)
        elif s == "Vacant":
            break
        else:
            N -= min(N//2,(L-N)//2)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
r = N-1
l = 0
print(0)
s = input()
cnt = 0
mid = (r+l)//2
if s == "Male":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Male" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Female" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2
        
elif s == "Female":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Female" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Male" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N = int(stdin.readline().rstrip())
print(0)
s = input()
cnt = 0
N = (N-1)//2
if s == "Male":
    while True:
        cnt += 1
        print(N)
        s = input()
        if s == "Male" and N % 2 == 0:
            N += max(1,(L-N)//2)
        elif s == "Female" and N % 2 != 0:
            N += max(1,(L-N)//2)
        elif s == "Vacant":
            break
        else:
            N -= max((N//2),1)
        if cnt > 25:
            break
        
elif s == "Female":
    while True:
        cnt += 1
        print(N)
        s = input()
        if s == "Female" and N % 2 == 0:
            N += max(1,(L-N)//2)
        elif s == "Male" and N % 2 != 0:
            N += max(1,(L-N)//2)
        elif s == "Vacant":
            break
        else:
            N -= max((N//2),1)
        if cnt > 25:
            break

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
r = N-1
l = 0
print(0)
s = input()
cnt = 0
mid = (r+l)//2
if s == "Male":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Male" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Female" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2
        
elif s == "Female":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Female" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Male" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N = int(stdin.readline().rstrip())
print(0)
s = input()
cnt = 0
N = (N-1)//2
if s == "Male":
    while True:
        cnt += 1
        print(N)
        s = input()
        if s == "Male" and N % 2 == 0:
            N += max(1,(L-N)//2)
        elif s == "Female" and N % 2 != 0:
            N += max(1,(L-N)//2)
        elif s == "Vacant":
            break
        else:
            N -= max((N//2),1)
        if cnt > 25:
            break
        
elif s == "Female":
    while True:
        cnt += 1
        print(N)
        s = input()
        if s == "Female" and N % 2 == 0:
            N += max(1,(L-N)//2)
        elif s == "Male" and N % 2 != 0:
            N += max(1,(L-N)//2)
        elif s == "Vacant":
            break
        else:
            N -= max((N//2)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
r = N-1
l = 0
print(0)
s = input()
cnt = 0
mid = (r+l)//2
if s == "Male":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Male" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Female" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2
        
elif s == "Female":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Female" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Male" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N = int(stdin.readline().rstrip())
print(0)
s = input()
N = (N-1)//2
if s == "Male":
    while True:
        print(N)
        s = input()
        if s == "Male" and N % 2 == 0:
            N += max(L-(N//2),1)
        elif s == "Female" and N % 2 != 0:
            N += max(L-(N//2),1)
        elif s == "Vacant":
            break
        else:
            N -= max((N//2),1)
        
elif s == "Female":
    while True:
        print(N)
        s = input()
        if s == "Female" and N % 2 == 0:
            N += max(1,L-(N//2))
        elif s == "Male" and N % 2 != 0:
            N += max(L-(N//2),1)
        elif s == "Vacant":
            break
        else:
            N -= max((N//2),1)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
r = N-1
l = 0
print(0)
s = input()
cnt = 0
mid = (r+l)//2
if s == "Male":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Male" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Female" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2
        
elif s == "Female":
    for _ in range(25):
        print(mid)
        s = input()
        if s == "Female" and mid % 2 == 0:
            l += max((r-l)//2,1)
        elif s == "Male" and mid % 2 != 0:
            l += max((r-l)//2,1)
        elif s == "Vacant":
            break
        else:
            r -= max((r-l)//2,1)
        mid = (r+l)//2