All problems

Excel Sheet Column Title

Easy · math

A spreadsheet names its columns with capital letters. The first 26 columns are A, B, ..., Z. After Z the names get longer: the next columns are AA, AB, ..., AZ, then BA, BB, ..., and so on up to ZZ, after which come AAA, AAB, and so on.

Given the position column_number of a column (the first column is number 1), return its name.

Examples

Example 1

Input: column_number = 1

Output: "A"

Example 2

Input: column_number = 28

Output: "AB"

Column 26 is Z and column 27 is AA, so column 28 is AB.

Example 3

Input: column_number = 703

Output: "AAA"

There are 26 one-letter names and 676 two-letter names, which is 702 columns. Column 703 is the first three-letter name.

Constraints