Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    N = int(input())
    left = 0
    right = N - 1
    table = ["?"]*N
    print(left)
    sys.stdin.flush()
    le = input()
    if le == "Vacant":
        return
    table[left] = le
    print(right)
    sys.stdin.flush()
    ri = input()
    if ri == "Vacant":
        return
    table[right] = ri

    for i in range(20):
        c = (left + right) // 2
        print(c)
        sys.stdin.flush()
        s = input()
        if s == "Vacant":
            return
        table[c] = s
        if (c - le + 1) % 2 == 0 and table[left] != table[c]:
            right = c
        elif (ri - c + 1) % 2 == 0 and table[right] != table[c]:
            left = c
        elif (c - le + 1) % 2 == 1 and table[left] == table[c]:
            right = c
        elif (ri - c + 1) % 2 == 1 and table[right] == table[c]:
            left = c
        else:
            raise Exception


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    N = int(input())
    left = 0
    right = N
    table = ["?"]*N
    print(left)
    sys.stdin.flush()
    le = input()
    if le == "Vacant":
        return
    table[left] = le

    for i in range(20):
        c = (left + right) // 2
        print(c)
        sys.stdin.flush()
        s = input()
        if s == "Vacant":
            return
        table[c] = s
        if (c - left) % 2 == 0 and table[left] == table[c]:
            left = c
        elif (c - left) % 2 == 1 and table[left] != table[c]:
            left = c
        else:
            right = c


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    N = int(input())
    left = 0
    right = N - 1
    table = ["?"]*N

    while 1:
        if table[left] == "?":
            print(left)
            sys.stdin.flush()
            le = input()
            if le == "Vacant":
                return
            table[left] = le
        if table[right] == "?":
            print(right)
            sys.stdin.flush()
            ri = input()
            if ri == "Vacant":
                return
            table[right] = ri
            c = (left + right) // 2
        if table[c] == "?":
            print(c)
            sys.stdin.flush()
            s = input()
            if s == "Vacant":
                return
            table[c] = s
        if (c - le) % 2 == 0 and table[left] != table[c]:
            right = c
        elif (ri - c) % 2 == 0 and table[right] != table[c]:
            left = c
        elif (c - le) % 2 == 1 and table[left] == table[c]:
            right = c
        elif (ri - c) % 2 == 1 and table[right] == table[c]:
            left = c
        else:
            raise Exception


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    N = int(input())
    left = 0
    right = N
    table = ["?"]*N
    print(left)
    sys.stdin.flush()
    le = input()
    if le == "Vacant":
        return
    table[left] = le

    for i in range(20):
        c = (left + right) // 2
        print(c)
        sys.stdin.flush()
        s = input()
        if s == "Vacant":
            return
        table[c] = s
        if (c - left) % 2 == 0 and table[left] == table[c]:
            left = c
        elif (c - left) % 2 == 1 and table[left] != table[c]:
            left = c
        else:
            right = c


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    N = int(input())
    left = 0
    right = N - 1
    table = ["?"]*N

    for i in range(21):
        c = (left + right) // 2
        if table[c] == "?":
            print(c)
            sys.stdin.flush()
            s = input()
            if s == "Vacant":
                return
            table[c] = s
        if table[left] == "?":
            print(left)
            sys.stdin.flush()
            le = input()
            if le == "Vacant":
                return
            table[left] = le
        if table[right] == "?":
            print(right)
            sys.stdin.flush()
            ri = input()
            if ri == "Vacant":
                return
            table[right] = ri
        if (ri - le) % 2 == 0 and table[left] != table[c]:
            right = c
        elif (ri - le) % 2 == 0 and table[right] != table[c]:
            left = c
        elif (ri - le) % 2 == 1 and table[left] == table[c]:
            right = c
        elif (ri - le) % 2 == 1 and table[right] == table[c]:
            left = c
        else:
            raise Exception


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    N = int(input())
    left = 0
    right = N
    table = ["?"]*N
    print(left)
    sys.stdin.flush()
    le = input()
    if le == "Vacant":
        return
    table[left] = le

    for i in range(20):
        c = (left + right) // 2
        print(c)
        sys.stdin.flush()
        s = input()
        if s == "Vacant":
            return
        table[c] = s
        if (c - left) % 2 == 0 and table[left] == table[c]:
            left = c
        elif (c - left) % 2 == 1 and table[left] != table[c]:
            left = c
        else:
            right = c


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    N = int(input())
    left = 0
    right = N - 1
    table = ["?"]*N

    for i in range(21):
        c = (left + right) // 2
        if table[c] == "?":
            print(c)
            sys.stdin.flush()
            s = input()
            if s == "Vacant":
                return
            table[c] = s
        if table[left] == "?":
            print(left)
            sys.stdin.flush()
            le = input()
            if le == "Vacant":
                return
            table[left] = le
        if table[right] == "?":
            print(right)
            sys.stdin.flush()
            ri = input()
            if ri == "Vacant":
                return
            table[right] = ri
        if table[left] != table[c]:
            right = c
        elif table[right] != table[c]:
            left = c
        else:
            raise Exception


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    N = int(input())
    left = 0
    right = N
    table = ["?"]*N
    print(left)
    sys.stdin.flush()
    le = input()
    if le == "Vacant":
        return
    table[left] = le

    for i in range(20):
        c = (left + right) // 2
        print(c)
        sys.stdin.flush()
        s = input()
        if s == "Vacant":
            return
        table[c] = s
        if (c - left) % 2 == 0 and table[left] == table[c]:
            left = c
        elif (c - left) % 2 == 1 and table[left] != table[c]:
            left = c
        else:
            right = c


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import sys
    N = int(input())
    left = 0
    right = N - 1
    table = ["?"]*N

    for i in range(21):
        c = (left + right) // 2
        if table[c] == "?":
            print(c)
            sys.stdin.flush()
            s = input()
            if s == "Vacant":
                return
            table[c] = s
        if table[left] == "?":
            print(left)
            sys.stdin.flush()
            le = input()
            if le == "Vacant":
                return
            table[left] = le
        if table[right] == "?":
            print(right)
            sys.stdin.flush()
            ri = input()
            if ri == "Vacant":
                return
            table[right] = ri
        if table[left] != table[c]:
            right = c
        elif table[right] != table[c]:
            left = c
        else:
            raise Exception


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    N = int(input())
    left = 0
    right = N
    table = ["?"]*N
    print(left)
    sys.stdin.flush()
    le = input()
    if le == "Vacant":
        return
    table[left] = le

    for i in range(20):
        c = (left + right) // 2
        print(c)
        sys.stdin.flush()
        s = input()
        if s == "Vacant":
            return
        table[c] = s
        if (c - left) % 2 == 0 and table[left] == table[c]:
            left = c
        elif (c - left) % 2 == 1 and table[left] != table[c]:
            left = c
        else:
            right = c


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    left = 0
    right = N - 1
    table = ["?"]*N

    for i in range(21):
        c = (left + right) // 2
        if table[c] == "?":
            print(c, flush=True)
            s = input()
            if s == "Vacant":
                return
            table[c] = s
        if table[left] == "?":
            print(left, flush=True)
            le = input()
            if le == "Vacant":
                return
            table[left] = le
        if table[right] == "?":
            print(right, flush=True)
            ri = input()
            if ri == "Vacant":
                return
            table[right] = ri
        if table[left] != table[c]:
            right = c
        elif table[right] != table[c]:
            left = c
        else:
            raise Exception


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    N = int(input())
    left = 0
    right = N
    table = ["?"]*N
    print(left)
    sys.stdin.flush()
    le = input()
    if le == "Vacant":
        return
    table[left] = le

    for i in range(20):
        c = (left + right) // 2
        print(c)
        sys.stdin.flush()
        s = input()
        if s == "Vacant":
            return
        table[c] = s
        if (c - left) % 2 == 0 and table[left] == table[c]:
            left = c
        elif (c - left) % 2 == 1 and table[left] != table[c]:
            left = c
        else:
            right = c


if __name__ == '__main__':
    main()