Leaderboard
Showing:
Column name from a given column number
Easy Accuracy: 30.03% Submissions: 27397 Points: 2

Given a positive integer, return its corresponding column title as appear in an Excel sheet.
MS Excel columns has a pattern like A, B, C, … ,Z, AA, AB, AC,…. ,AZ, BA, BB, … ZZ, AAA, AAB ….. etc. In other words, column 1 is named as “A”, column 2 as “B”, column 27 as “AA”.

Input:
The first line of each input consists of the test cases. And, the second line consists of a number N.

Output:
In each separate line print the corresonding column title as it appears in an Excel sheet.

Constraints:
1 ≤ T ≤ 70
1 ≤ N ≤ 4294967295

Example:
Input:
2
28
13

Output:
AB
M

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Column name from a given column number

Output Window