Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from sys.stdout import flush

def inpl(): return tuple(map(int, input().split()))

def ismale(S):
    if S == "Male":
        return 1
    elif S == "Female":
        return 0
    else:
        exit()

N = int(input())
print(0)
flush()

c0 = ismale(input())
w = c0

C = [0 for _ in range(N)]
if c0 == 1:
    C[::2] = [1]*(N//2+1)
else:
    C[1::2] = [1]*(N//2)

L = 0
R = N - 1
post = (R - L + 1)//2
while True:
    print(post)
    flush()
    
    if post % 2 == 1:
        c = ismale(input())
        if c != w:
            L = post + 1
        else:
            R = post - 1
    else:
        c = ismale(input())
        if c != w:
            R = post
        else:
            L = post + 1

    if R - L == 2:
        print((R-L+1)//2)
        flush()
        c = ismale(input())
        print(R)
        flush()
        c = ismale(input())
        print(L)
        flush()
        c = ismale(input())
    else:
        post = (R - L + 1)//2

Fixed submission:
# -*- coding: utf-8 -*-
import sys

def inpl(): return tuple(map(int, input().split()))

def ismale(S):
    if S == "Male":
        return 1
    elif S == "Female":
        return 0
    else:
        exit()

N = int(input())
print(0)
sys.stdout.flush()

c0 = ismale(input())
w = c0

C = [0 for _ in range(N)]

L = 0
R = N - 1
post = (R + L)//2
while True:
    print(post)
    sys.stdout.flush()
    
    if post % 2 == 1:
        c = ismale(input())
        if c != w:
            L = post + 1
        else:
            R = post - 1
    else:
        c = ismale(input())
        if c != w:
            R = post
        else:
            L = post

    if R - L == 2:
        print((R+L+1)//2)
        sys.stdout.flush()
        c = ismale(input())
        print(R)
        sys.stdout.flush()
        c = ismale(input())
        print(L)
        sys.stdout.flush()
        c = ismale(input())
    else:
        post = (R + L)//2

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from sys.stdout import flush

def inpl(): return tuple(map(int, input().split()))

def ismale(S):
    if S == "Male":
        return 1
    elif S == "Female":
        return 0
    else:
        exit()

N = int(input())
print(0)
flush()

c0 = ismale(input())
w = c0

C = [0 for _ in range(N)]
if c0 == 1:
    C[::2] = [1]*(N//2+1)
else:
    C[1::2] = [1]*(N//2)

L = 0
R = N - 1
post = (R - L + 1)//2
while True:
    print(post)
    flush()
    
    if post % 2 == 1:
        c = ismale(input())
        if c != w:
            L = post + 1
        else:
            R = post - 1
    else:
        c = ismale(input())
        if c != w:
            R = post
        else:
            L = post + 1

    if R - L == 2:
        print((R-L+1)//2)
        c = ismale(input())
        print(R)
        c = ismale(input())
        print(L)
        c = ismale(input())
    else:
        post = (R - L + 1)//2

Fixed submission:
# -*- coding: utf-8 -*-
import sys

def inpl(): return tuple(map(int, input().split()))

def ismale(S):
    if S == "Male":
        return 1
    elif S == "Female":
        return 0
    else:
        exit()

N = int(input())
print(0)
sys.stdout.flush()

c0 = ismale(input())
w = c0

C = [0 for _ in range(N)]

L = 0
R = N - 1
post = (R + L)//2
while True:
    print(post)
    sys.stdout.flush()
    
    if post % 2 == 1:
        c = ismale(input())
        if c != w:
            L = post + 1
        else:
            R = post - 1
    else:
        c = ismale(input())
        if c != w:
            R = post
        else:
            L = post

    if R - L == 2:
        print((R+L+1)//2)
        sys.stdout.flush()
        c = ismale(input())
        print(R)
        sys.stdout.flush()
        c = ismale(input())
        print(L)
        sys.stdout.flush()
        c = ismale(input())
    else:
        post = (R + L)//2