# Arup Guha
# 11/18/2012
# Solution to Junior Knights Homework 7E: Marble Game

def main():

    numMarbles = int(input("How many marbles will you be playing with?\n"))

    playerTurn = 2

    # Play until there are no more marbles left.
    while numMarbles > 0:

        # Simple way to change who's turn it is.
        playerTurn = 3 - playerTurn

        # Process this turn.
        print("Player #", playerTurn,", there are ", numMarbles, " marbles left.", sep = "")
        turn = int(input("How many marbles will you take?\n"))
        numMarbles = numMarbles - turn

    # Print out the result.
    print("Player #",playerTurn,", you took the last marble and have won!", sep = "")

main()
