#include<bits/stdc++.h>
using namespace std ;
#define endl "\n"

int n ;
void Try(string s){
    int length = s.size();
    if(length == n ){
        if(s[length - 1] == '6')
            cout << s << endl ;
        return ;
    }
    
    if(s[length - 1] == '8') Try(s + "6");
    else{
        if(length < 4) Try(s + "6");
        else if(s[length - 2] == '8' || s[length - 3] == '8') Try(s + "6");
        else Try(s + "8");
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    cin >> n ;
    Try("8");
}