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