#include <bits/stdc++.h>
using namespace std;

string to_binary(int n){
    if (n == 0) return "0";

    string res;
    while(n){
        if(n % 2 == 1){
            res += '1';
        } else {
            res += '0';
        }
        n /= 2;
    }
    reverse(res.begin(), res.end()); // To get MSB to LSB
    return res;
}

int main() {
    string res = to_binary(7);
    cout << res;
    return 0;
}
