#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int year;
cout<<"請輸入1800-2018之間的一個年份"<<endl;
cin>>year;
if(1800<=year && year<=2018){
switch((year-1800)%10){
case 4:cout<<"甲";break;
case 5:cout<<"乙";break;
case 6:cout<<"丙";break;
case 7:cout<<"丁";break;
case 8:cout<<"戊";break;
case 9:cout<<"已";break;
case 0:cout<<"庚";break;
case 1:cout<<"辛";break;
case 2:cout<<"壬";break;
case 3:cout<<"癸";break;
}
switch((year-1800)%12){
case 0:cout<<"酉"<<endl;break;
case 1:cout<<"戌"<<endl;break;
case 2:cout<<"亥"<<endl;break;
case 3:cout<<"子"<<endl;break;
case 4:cout<<"丑"<<endl;break;
case 5:cout<<"寅"<<endl;break;
case 6:cout<<"卯"<<endl;break;
case 7:cout<<"辰"<<endl;break;
case 8:cout<<"巳"<<endl;break;
case 9:cout<<"午"<<endl;break;
case 10:cout<<"未"<<endl;break;
case 11:cout<<"申"<<endl;break;
}
}
return 0;
}