import java.util.Scanner;
public class ListTest {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String num1 = in.next();
changeTo2Binary(16, num1))
}
private static int[] radixs = new int[]{2,4,8,10,16};
private static int[] radix10 = new int[]{1,2,4,8,16,32,64,128,256,512, 1024};
private static String[] radix16 = new String[]{"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"};
private static String[] radix8 = new String[]{"000","001","010","011","100","101","110","111"};
private static String[] radix4 = new String[]{"00","01","10","11"};
private static String changeTo2Binary(int radix, String num) {
char[] nums = num.toCharArray();
boolean is16 = false;
for (char n : nums) {
if (n >=97) {
is16 = true;
break;
}
}
if (is16 && radix != 16) {
return "error";
}
StringBuilder builder = new StringBuilder();
if (radix == 10) {
boolean start = true;
int num10 = Integer.valueOf(num);
for (int j = 10; j >=0 ; j--) {
if (num10/radix10[j] > 0) {
start = false;
builder.append("1");
num10 = num10%radix10[j];
}else if (!start) {
builder.append("0");
}
}
}
if (radix == 16) {
for (char b : nums) {
builder.append(radix16[getIndex(b)]);
}
}
if (radix == 8) {
for (char b : nums) {
builder.append(radix8[getIndex(b)]);
}
}
if (radix == 4) {
for (char b : nums) {
builder.append(radix4[getIndex(b)]);
}
}
if (radix == 2) {
return num;
}
String ans = builder.toString();
char[] anss = ans.toCharArray();
int startIndex = -1;
for (int n = 0; n< anss.length; n++) {
if (anss[n] == '1') {
startIndex = n;
break;
}
}
if (startIndex == -1) {
return "0";
}
return ans.substring(startIndex);
}
public static int getIndex(char a) {
if (a >= 97) {
return a-87;
} else {
return a-48;
}
}
}