MAY99_2 - Manku Word

Manku loves Codechef's Lucky Number and now he decided to start Manku words :)

Manku words are those words which have only letters 'm', 'a', 'n', 'k', 'u'.

Generally in english, 'a' comes before 'k', 'k' comes before 'm' and so on. But in Manku's dictionary, 'm' comes before 'a', 'a' comes before 'n', 'n' comes before 'k', 'k' comes before 'u'.

Thus according to manku

  • 1st manku word is m
  • 2nd manku word is a
  • 3rd manku word is n
  • 4th manku word is k
  • 5th manku word is u
  • 6th manku word is mm
  • 7th manku word is ma
and so on ...

Your task is very simple. For given value of n, write the n-th manku word.

Input

First line of input contains an integer t (1 <= t <= 100).

Each test case contains an integer n (1 <= n <= 10^18).

Output

For every test case print the n-th manku word on separate line.

Example

Input:
5
10
4
16
17
31

Output:
mu
k
nm
na
mmm

Added by:Mayank Tuteja
Date:2013-01-17
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM32 ASM64 GAWK BASH BF CSHARP C99 CLPS CLOJURE LISP sbcl LISP clisp D ERL FSHARP FORTRAN GO HASK ICON ICK JS-RHINO LUA NEM NICE NODEJS OCAML PAS-GPC PIKE PRLG-swi RUBY SCALA SCM guile SCM qobi SED ST TCL WHITESPACE
Resource:similar to codechef's lucky number

hide comments
2014-12-20 08:25:19 Sourabh Ghurye
SIGSEGV for the 5th case.
please help.
id=13218786
2014-11-06 13:02:42 Sahil Dua
0.11 AC Best PYTH 2.7 Solution :)

Moved the entire code into main rather than separate function --> improvement of 0.02s
2014-10-24 11:51:53 Vaibhav Gosain
same as TSHOW1
2014-10-01 21:51:09 Ashish Sareen
Nice problem , made me find a new approach for the tshow

Last edit: 2014-10-01 21:51:34
2014-06-30 18:51:53 Ranjan Kumar Singh
long long int l,
pow(5,l) for l=2 giving 24..???
2014-06-27 15:28:20 L
Same code with a little change worked for TSHOW1.
2014-06-27 15:18:07 Naruto uzumaki
1st person to get TLE .lol :x
2014-05-30 00:07:43 Naveen Sangtani
can anybody tell me why inbuilt pow function gave wrong answer in case of large numbers and by declaring own power function ... my same previous code gets AC..!!!
??
2014-01-12 13:00:13 |RAMSDEN|
@Mayank Tuteja pls check my submission
id 10852718
Edit: AC ! :-)

Last edit: 2014-01-12 13:07:52
2013-10-23 00:38:05 Martijn Muijsers
Damn I got a WA because of I64d instead of lld XD
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.