#include <stdio.h>

int main(void) {
	
	int t;
	
	scanf("%d",&t);
	
	switch(t){
		case 1:
			printf("A");
			break;
		case 2:
		case 3:
		case 4:
		case 5:
		case 6:
		case 7:
		case 8:
		case 9:
		case 10:
			printf("%d",t);
			break;
		case 11:
			printf("J");
			break;
		case 12:
			printf("Q");
			break;
		case 13:
			printf("K");
			break;
		default:
			printf("そんなカードはないよ！");
			break;
	}
	return 0;
}
