#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    long long N;
    cin >> N;
    
    if (N <= 0) {
        cout << "Invalid Input";
        return 0;
    }
    
    string s = ;
    
    while (N > 0) {
        if (N % 2 == 1)
            s += '3';
        else
            s += '4';
        N = (N - 1) / 2;
    }
    
    reverse(s.begin(), s. end());
    cout <<  s;
    
    return 0;
}
        
     
     
             
        }
    }
}