import sys input = sys.stdin.readline from collections import deque from bisect import bisect_left, bisect_right import itertools #from math import * for t in range(1, int(input())+1): n = int(input()) c = 26 a = 0 while a+c < n: a += c c += 26 u = (n-a+c//26-1)//(c//26) print("Case #{}: {}".format(t, chr(u+64)))