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<=10^14.

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
2012-07-19 07:42:31 Broken_Sword
whats the output for 0 and 1 ?
2012-07-07 21:00:25 Aditya
HInt is, if 3 is muliplied to any number , can it be then expressed in the form 2^k ?no..
2012-07-01 15:14:59 reo_j
any tricky case plz..!!!
2012-06-22 18:10:36 johnny
@devil: lol its a psudocode////
2012-06-16 08:16:40 :)
there is something wrong
( n mod 2 = 0) = should be ==
also := should be = ???
2012-06-01 11:58:27 Ashish Raj
nice 1 :)
2012-06-01 00:38:47 Artur Freitas
thank you very much ,Hemant Verma ! ;D
2012-05-30 08:43:20 Pranshul Agarwal
thnx Hemant Verma
2012-05-30 07:46:35 Hemant Verma
use unsigned long long
2012-05-30 07:09:01 Pranshul Agarwal
can smbdy tell why am i getting WA again n again?? is it right that we have to print "TAK" for 0 and 1 ????
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.