시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 102 78 72 80.899%

문제

엑셀의 첫번째 열은 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
W3sicHJvYmxlbV9pZCI6IjI3NTciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM1ZDFcdWMxNDAiLCJkZXNjcmlwdGlvbiI6IjxwPlxyXG5cdFx1YzVkMVx1YzE0MFx1Yzc1OCBcdWNjYWJcdWJjODhcdWM5ZjggXHVjNWY0XHVjNzQwIEFcdWM3NzRcdWFjZTAsIFx1YjQ1MFx1YmM4OFx1YzlmOCBcdWM1ZjRcdWM3NDAgQlx1Yzc3NFx1YWNlMCwgMjZcdWJjODhcdWM5ZjggXHVjNWY0XHVjNzQwIFpcdWM3NzRcdWIyZTQ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