package LQB;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Basic9 {
//十进制转化为十六进制
public static void main(String [] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
Map<Integer, String> map = new HashMap<Integer, String>();
for(int i=0;i<10;i++){
map.put(i,String.valueOf(i));
}
for(int i = 10;i<=15;i++){
map.put(i,String.valueOf((char)(55+i)));
}
List<Integer> list = new ArrayList<Integer>();
int b=0;//作为商
int c=0;//作为余数
boolean flag = true;
while(flag==true){
c=n%16;
list.add(c);
b=n/16;
n=b;
if(b<16){
if(b!=0){
list.add(b);
}
flag=false;
}
}
for(int i=list.size()-1;i>=0;i--){
System.out.print(map.get(list.get(i)));
}
}
}