WILLITST - Will it ever stop

When Bob was in library in University of Warsaw he saw on one of facades caption :"Will it ever stop?" and below some mysterious code:

while n > 1
  if n mod 2 = 0 then
    n := n / 2
  else
    n := 3 * n + 3

Help him finding it out !

Input

In first line one number n ≤ 1014.

Output

Print "TAK" if program will stop, otherwise print "NIE"

Example

Input:
4

Output:
TAK

Added by:Krzysztof Lewko
Date:2011-11-09
Time limit:0.906s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:AMPPZ 2011

hide comments
2013-04-12 20:54:15 xxx
Use Unsigned long long for c/c++ users.....i have changed after 5 wa's...long long did'nt work ....Happy Coding !!
2013-03-22 14:31:43 Jagatheesvaran Palanisamy
just try this routine for n=0 to 100...u will find the soln
2013-02-20 11:59:38 Sivaraman Nagarajan
Nothing Big In It
2013-02-07 09:03:19 ankitsablok89
program culminated in a single line :)
2013-01-03 07:30:50 Mukund Kumar
my submission id : 8400204
can u plz tell me what z wrong wid my code??it z running till 17th test case
2012-12-28 02:52:47 Seshadri R
@simon: Operator precedence and order of evaluation
2012-12-17 10:08:56 Suyash Garg
shortest code ever written :)
2012-12-14 13:09:53 simon
anyone knows why if n % 2 == 0: is accepted while if not n % 2: give NZEC?
2012-11-07 22:56:59 malioboro
tricky test case, be careful
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.