Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.
Problem hidden on 2012-06-13 13:30:33 by :D

FAMILYP - Family Problems

Asif and Nafisa are very interested in solving puzzles.They always try to give one another puzzles to see who is the best.So ,as usual, one day, Nafisa gave Asif a matrix.

The matrix is as follows

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C ......
B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D ......
C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E ......
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E F .......
.........................................................................................
.
.

Assume that the matrix is very huge(both row and column wise). Nafisa describes a special sequence as a sequence  whose first term is 'A'[element at (0,0)], second term is 'B'[element at  (0,1)],third term is 'B'[element at (1,0)],fourth term is 'C'[element at (2,0)]. Now,she asks Asif to find the nth term of this special sequence. Help Asif To solve the problem.

Input

There will be multiple test cases with number N(1<=N<=1000000) per line.

Output

A character ['A'-'Z'] per line for each number N representing the Nth number in the special sequence.

Example

Input:
3
6
10

Output: TERM 3 IS B
TERM 6 IS C
TERM 10 IS D

Added by:Hemant Verma
Date:2009-11-14
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 NODEJS OBJC PERL6 SQLITE VB.NET
Resource:Alkhwarizm 2009

hide comments
2011-04-30 06:04:48 wujinyang1998
i don't understand why it can't AC :(
pascal code:

program t1;
var
i,j,n,m:longint;
begin
while not eof do
begin
readln(n);
m:= 1;
j:= 1;
while n > m do
begin
n:= n - m;
m:= m + 1;
j:= j + 1;
end;
writeln('TERM ',n,' IS ',chr((j - 1) mod 26 + 65));
end;
end.
2011-04-30 04:04:29 Virgo
what is the hell with output,I get AC with code :
#include<stdio.h>
int main() {
int d;
while( scanf("%d",&d) > 0 )
return 0;
}
2011-04-25 17:08:07 albertg
EVERY TIME I GET WRONG ANSWER!HELP


Last edit: 2011-04-26 06:22:59
2011-04-25 17:07:11 albertg
HOW MANY TEST CASES?
2011-02-25 17:36:40 Jay Pandya
what is this man???? i was getting runtime error... so i just tried to submit the code which only takes input..do not print the output..(i commented the output part to check whether there is a problem in printing or not)...but..oh lord, IT GOT ACCEPTED!!!! what a mess with input file!!!! i have lost faith in this problem..just print nothing and you get accepted!!!
2011-02-11 16:11:39 HELLO
sequence is not clear can anyone explain me
2010-12-16 14:23:47 anurag
after solving this try canton and canton2(challenge)
2010-10-30 16:53:34 Muntasir Azam Khan
Please either
a) Update the problem statement telling to stop on a blank line
or b) Fix the judge data

Stupid mistakes like this in the Judge data and unclear problem statements can really ruin a problem.
2010-05-19 16:35:55 sudipto das
just use
while(scanf("%d",&N)>0)
{
-------//code
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.