Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

print(0)
s0 = str(input())

print(n-1)

def is_ok(x):
    print(x)
    s = str(input())
    if x%2 == 1:
        if s != s0:
            return False
        else:
            return True
    else:
        if s == s0:
            return False
        else:
            return True


l = 0
r = n-1
while l+1 < r:
    c = (l+r)//2
    if is_ok(c):
        r = c
    else:
        l = c


Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

print(0)
s0 = str(input())

print(n-1)

def is_ok(x):
    print(x)
    s = str(input())
    if s == s0:
        return False
    else:
        return True

l = 1
r = n-2
while l+1 < r:
    c = (l+r)//2
    if is_ok(c):
        r = c
    else:
        l = c


Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

print(0)
s0 = str(input())

print(n-1)

def is_ok(x):
    print(x)
    s = str(input())
    if s == s0:
        return False
    else:
        return True

l = 0
r = n-2
while l+1 < r:
    c = (l+r)//2
    if is_ok(c):
        r = c
    else:
        l = c


Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

print(0)
s0 = str(input())

print(n-1)

def is_ok(x):
    print(x)
    s = str(input())
    if s == s0:
        return False
    else:
        return True

l = 0
r = n-1
while l+1 < r:
    c = (l+r)//2
    if is_ok(c):
        r = c
    else:
        l = c        


Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

def q(i):
    print(i)
    s = str(input())
    if s == 'Vacant':
        exit()
    else:
        return s

x = q(0)

def ok(m):
    if m == 0:
        return False
    else:
        if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
            return True
        else:
            return False

l = 0
r = n-1
while l+1 < r:
    c = (l+r)//2
    if ok(c):
        r = c
    else:
        l = c

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

def q(i):
    print(i)
    s = str(input())
    if s == 'Vacant':
        exit()
    else:
        return s

x = q(0)

def ok(m):
    if m == 0:
        return False
    else:
        if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
            return True
        else:
            return False

l = 0
r = n-1
while l+1 < r:
    c = (l+r)//2
    if ok(c):
        r = c
    else:
        l = c

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = 0
r = n-1
print(0)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sl = s

while l+1 < r:
    c = (l+r)//2
    print(c)
    s = str(input())
    if s == 'Vacant':
        exit()
    else:
        if s == sl:
            l = c
            sl = s
        else:
            r = c

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = 0
r = n-1
print(0)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sl = s
print(n-1)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sr = s

while l+1 < r:
    c = (l+r)//2
    print(c)
    s = str(input())
    if s == 'Vacant':
        exit()
    else:
        if s == sl:
            l = c
            sl = s
        else:
            r = c
            sr = s

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = 0
r = n-1
print(0, flush=True)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sl = s
print(n-1, flush=True)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sr = s

while l+1 < r:
    c = (l+r)//2
    print(c, flush=True)
    s = str(input())
    if s == 'Vacant':
        exit()
    else:
        if s == sl:
            l = c
            sl = s
        else:
            r = c
            sr = s

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = 0
r = n-1
print(0, flush=True)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sl = s
print(n-1, flush=True)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sr = s

while l+1 < r:
    c = (l+r)//2
    print(c, flush=True)
    s = str(input())
    if s == 'Vacant':
        exit()
    else:
        if s == sl:
            l = c
            sl = s
        else:
            r = c
            sr = s

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = 0
r = n-1
print(0)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sl = s
print(n-1)
s = str(input())
if s == 'Vacant':
    exit()
else:
    sr = s

while l+1 < r:
    c = (l+r)//2
    print(c)
    s = str(input())
    if s == 'Vacant':
        exit()
    else:
        if s == sl:
            l = c
            sl = s
        else:
            r = c
            sr = s

Fixed submission:
def main():
    n = int(input())

    def q(i):
        print(i, )
        s = str(input())
        if s == 'Vacant':
            exit()
        else:
            return s

    x = q(n-1)
    x = q(0)

    def ok(m):
        if m == 0:
            return False
        else:
            if (m%2 == 0 and q(m) != x) or (m%2 == 1 and q(m) == x):
                return True
            else:
                return False

    l = 0
    r = n-1
    while l+1 < r:
        c = (l+r)//2
        if ok(c):
            r = c
        else:
            l = c

if __name__ == '__main__':
    main()