//本题位数较大,超出了long long范围,而在十进制转二进制的过程中需不断除进制2,这个过程需借助字符串处理
//从最高位开始处理,currnet表示当前正在处理的位, (current / 进制) 得出商对应的当前位,若有余数,则余数乘10并加上下一位,循环遍历完所有的字符,remain初始化为0
#include <iostream>
#include <vector>
#include <string>
using namespace std;
string divide(string str) {
int remain = 0;
for (int i = 0; i < str.size(); i++) {
int current = remain * 10 + str[i] - '0';
str[i] = current / 2 + '0';
remain = current % 2;
}
int pos = 0;
while (str[pos] == '0') {
pos++;
}
return str.substr(pos);
}
int main() {
string str;
// while (scanf("%s", &str) != EOF) {
while (cin >> str) {
// if (str == "0") {
// printf("0");
// }
vector <int> vec;
while (str!="") { //一般是除数为0时跳出循环,但由于除法去掉了前导0,就会返回空串
int remain = str[str.size() - 1]-'0';
vec.push_back(remain % 2);
str = divide(str);
}
for (int i = vec.size() - 1; i >= 0; i--) {
printf("%d", vec[i]);
//vec.pop_back();
}
printf("\n");
}
return 0;
}