• + 1 comment

    The pattern emerges pretty quickly if you start from 1 stone and look at if the first player will win or lose with each stone you add.

    SPOILER

    You'll find that the first player will lose when the starting number of stones s is: 1,7,8,14,15,21,22... (i.e. when s % 7 < 2). With this knowledge in hand the code is trivial:

    t = int(raw_input())
    for _ in xrange(t):
        s = int(raw_input())
        if s % 7 < 2:
            print 'Second'
        else:
            print 'First'