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
2013-07-05 11:17:49 orange
@ Erti-Chris Eelmaa yes!! there is formula for this.
2013-07-04 04:40:15 ..........
Got AC at first attempt..:)
2013-07-02 13:39:23 fdfdfwgwg
mine shows nzec after 20 cases- http://ideone.com/sKblYc

any suggestions?

Last edit: 2013-07-02 13:41:14
2013-06-29 20:09:39 ganpya
this is the case of repetition..use map and plz use unsigned long long...long long wont work

Got AC

Last edit: 2013-06-29 20:10:03
2013-06-21 21:55:07 « sudipto »
lolzz.. got wa coz of printing NEI in place of NIE... AC;)
2013-06-21 18:56:15 Vipul Pandey
long long int will work, no need of unsigned long long.
2013-06-12 06:47:40 Prikshit Kumar
Easy Problem.
Got AC at first attempt..:)
2013-06-03 08:03:14 Erti-Chris Eelmaa
3 minutes, really easy exercise. though I believe there should be formula that can do this without loop?
2013-05-21 14:15:19 Rishabh Dugar
ac at first try!!
2013-05-17 12:27:08 Noob
long long worked for me C/C++
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.