#include using namespace std; int cost[] = { 6, 2, 5, 5, 4, 5, 6, 3, 7, 6 }; signed main(){ int N; cin >> N; int maxlen = N / 2; while( N >= 2 and maxlen ){ for( int i = 9; i >= 0; --i ) if( N >= cost[ i ] and maxlen - 1 == ( N - cost[ i ] ) / 2 ){ cout << i; N -= cost[ i ]; break; } --maxlen; } return 0; }