Under construction

Still being built. Things may change

Hungry Ari Buys a Sandwich

Interview

Time limit1sMemory limit1024 MB

Summary
Given a sandwich price S and Kugi's money M, decide whether Ari can pay alone, needs Kugi's coins, or cannot pay even with Kugi's help.
Level

Easy3 of 10

Topics
Bit manipulation, Math
Solved
No attempts yet

Problem

"두리" is a country. Its coins come in ten denominations: 1, 2, 4, 8, 16, 32, 64, 128, 256, and 512 won. Ari, a citizen of Duri, has one coin of each denomination, ten coins in total.

Ari goes to a bakery to buy a sandwich. The bakery has no change, so the sandwich price SS won must be paid exactly, or it cannot be bought. While Ari is working out the payment, Ari's friend Kugi walks into the bakery. Kugi has one coin each of some of the ten denominations (not necessarily all of them), and the coins total MM won. Kugi can lend any part or all of that money to Ari. However, Ari will not borrow while keeping some of Ari's own money. Ari must spend all of Ari's own coins first and then borrow only the shortfall from Kugi.

Ari wants to greet Kugi differently depending on the situation. Find what Ari should say to Kugi.

Input

The first line contains the sandwich price SS (1 ≤ SS ≤ 2048) and the amount MM (1 ≤ MM ≤ 1023) that Kugi has, separated by a space.

Output

If Ari can buy the sandwich with Ari's own money alone, print No thanks. If Ari needs Kugi's help to buy it, print Thanks. If the sandwich cannot be bought even when Kugi lends all of the money, print Impossible.

Examples3

  1. Example 1

    Input
    1023 12
    
    Expected output
    No thanks
    
  2. Example 2

    Input
    1024 1
    
    Expected output
    Thanks
    
  3. Example 3

    Input
    1024 2
    
    Expected output
    Impossible