#include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; string divide(string input_str,int div_number, int& mod) { string result = ""; for (int i = 0; i < input_str.size(); i++) { int number = input_str[i] - '0'; int sum = mod * 10 + number; int data = sum / div_number; result=result+to_string(data); mod = sum % div_number; } while (result.size() != 0 && result[0] == '0') { result.erase(0, 1); } if (result.size() == 0) { return "0"; } else { return result; } } string transform(string input_str) { string result = ""; if (input_str == "0") return "0"; while (input_str!="0") { int mod = 0; input_str = divide(input_str,2, mod); result = result + to_string(mod); } reverse(result.begin(), result.end()); return result; } int main() { string input_str; while (cin>>input_str) { string binary_result = transform(input_str); cout << binary_result << endl; } }