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

hide comments
xxx: 2013-04-12 20:54:15

Use Unsigned long long for c/c++ users.....i have changed after 5 wa's...long long did'nt work ....Happy Coding !!

Jagatheesvaran Palanisamy: 2013-03-22 14:31:43

just try this routine for n=0 to 100...u will find the soln

Sivaraman Nagarajan: 2013-02-20 11:59:38

Nothing Big In It

ankitsablok89: 2013-02-07 09:03:19

program culminated in a single line :)

Mukund Kumar: 2013-01-03 07:30:50

my submission id : 8400204
can u plz tell me what z wrong wid my code??it z running till 17th test case

Seshadri R: 2012-12-28 02:52:47

@simon: Operator precedence and order of evaluation

Suyash Garg: 2012-12-17 10:08:56

shortest code ever written :)

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


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