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

hide comments
simon: 2012-12-14 13:09:53

anyone knows why if n % 2 == 0: is accepted while if not n % 2: give NZEC?

malioboro: 2012-11-07 22:56:59

tricky test case, be careful

gourav: 2012-10-17 14:42:19

18th :)

rathor ashu: 2012-10-02 20:48:19

Same Algo c => NZEC. C++ => AC

Vikas Kushwaha: 2012-09-27 18:25:03

easy one :)

Omar Simón Francisco Prieto Chacón - osfprieto: 2012-09-17 22:16:48

Is it just one input number or several test cases?

Vrian7: 2012-09-08 10:18:29

@:) It is pascal, this is not c++ or java..

code warrior: 2012-09-07 18:23:44

how to operate on such a large numbers.
declaring string of such length is not allowed..
suggesstions r welcomed

piyush agarwal: 2012-08-15 15:18:14

any hint please..i m getting wa again n again...or any tricky case!!


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