시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 105 81 75 81.522%

문제

엑셀의 첫 번째 열은 A이고, 두 번째 열은 B이고, 26번째 열은 Z이다. 26번째 열 다음 열부터는 2글자를 이용한다. 

예를 들어, 27번째 열은 AA이고, 28번째 열은 AB, 52번째 열은 AZ이다. 그 다음 53번째 열은 BA이며, 이와 같이 계속 열의 이름을 붙인다.

ZZ열 다음 열은 AAA가 되고, 그 다음은 AAB가 된다.

엑셀에서 행은 그냥 행 번호를 사용하면 된다.

엑셀 스프레드시트에서 각 칸은 위에서 설명한 열과 행을 합쳐서 이름을 만들 수 있다. 가장 왼쪽 위에 있는 칸은 A1이 되고, 55열 23행에 있는 칸은 BC23이 된다.

열과 행이 주어졌을 때, 그 칸의 엑셀 스프레드시트 상에서 이름을 출력하는 프로그램을 작성하시오.

입력

입력은 여러 줄이며, RnCm형태이다. n은 행 번호 (1<=n<=300000000), m은 열 번호 (1<=m<=300000000) 이다. 입력의 마지막은 n과 m이 모두 0이며, 이때는 출력하지 않고 프로그램을 종료하면 된다.

출력

각 입력을 순서대로 한 줄에 하나씩 엑셀 스프레드시트 상에서의 이름을 출력하면 된다.

예제 입력 1

R1C1
R3C1
R1C3
R299999999C26
R52C52
R53C17576
R53C17602
R0C0

예제 출력 1

A1
A3
C1
Z299999999
AZ52
YYZ53
YZZ53
W3sicHJvYmxlbV9pZCI6IjI3NTciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM1ZDFcdWMxNDAiLCJkZXNjcmlwdGlvbiI6IjxwPlxyXG5cdFx1YzVkMVx1YzE0MFx1Yzc1OCBcdWNjYWIgXHViYzg4XHVjOWY4IFx1YzVmNFx1Yzc0MCBBXHVjNzc0XHVhY2UwLCBcdWI0NTAgXHViYzg4XHVjOWY4IFx1YzVmNFx1Yzc0MCBCXHVjNzc0XHVhY2UwLCAyNlx1YmM4OFx1YzlmOCBcdWM1ZjRcdWM3NDAgWlx1Yzc3NFx1Y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