#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string toBinary(int n){
    string bin = "";
    while(n>0){
        bin += (n%2) + '0';
        n /= 2;
    }
    reverse(bin.begin(),bin.end());
    return bin;
}
int main(){
    int N;
    cin>>N;
    if(N<0){
        cout<<"Invalid input";
        return 0;
    }
    for(int i=1; i<=N;i++){
        string bin = toBinary(i);
        string modified = "";
        for(int j=0;j<bin.length();j++){
            if(bin[j]=='1'){
                modified +='4';
                else
                modified +='3'
            }
        }
        cout<<modified;
        if(i!=N)
        cout<<"";
    }
    return 0;
}