#include <bits/stdc++.h>
using namespace std;
const int N = 5000; int dp[ 2 ][ N ];
int sum_of_digits( int x )
{
int z = 0;
for( auto c: to_string( x ) )
z += c - '0';
return z;
}
int main()
{
ios_base::sync_with_stdio( false ), cin.tie( nullptr ), cout.tie( nullptr );
for( int x = 0, y = 0; x < N; x++, y += 2 )
dp[ 0 ][ x ] = sum_of_digits( x ),
dp[ 1 ][ x ] = sum_of_digits( y );
for( int x1 = 0; x1 < N; x1++ )
for( int s1 = 50 - dp[ 0 ][ x1 ], t1 = 55 - dp[ 1 ][ x1 ], x2 = x1; x2 < N; x2++ )
if ( dp[ 0 ][ x2 ] == s1 and dp[ 1 ][ x2 ] == t1 )
{
cout << x1 << x2 << x1 << x2; return 0;
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE4gPSA1MDAwOyBpbnQgZHBbIDIgXVsgTiBdOwoKaW50IHN1bV9vZl9kaWdpdHMoIGludCB4ICkKewogICAgaW50IHogPSAwOwogICAgCiAgICBmb3IoIGF1dG8gYzogdG9fc3RyaW5nKCB4ICkgKQogICAgICAgIHogKz0gYyAtICcwJzsKICAgICAgICAKICAgIHJldHVybiB6Owp9CgoKaW50IG1haW4oKQp7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKCBmYWxzZSApLCBjaW4udGllKCBudWxscHRyICksIGNvdXQudGllKCBudWxscHRyICk7CiAgICAKICAgIGZvciggaW50IHggPSAwLCB5ID0gMDsgeCA8IE47IHgrKywgeSArPSAyICkKICAgICAgICBkcFsgMCBdWyB4IF0gPSBzdW1fb2ZfZGlnaXRzKCB4ICksCiAgICAgICAgZHBbIDEgXVsgeCBdID0gc3VtX29mX2RpZ2l0cyggeSApOwogICAgICAgIAogICAgZm9yKCBpbnQgeDEgPSAwOyB4MSA8IE47IHgxKysgKQogICAgICAgIGZvciggaW50IHMxID0gNTAgLSBkcFsgMCBdWyB4MSBdLCB0MSA9IDU1IC0gZHBbIDEgXVsgeDEgXSwgeDIgPSB4MTsgeDIgPCBOOyB4MisrICkKICAgICAgICAgICAgaWYgKCBkcFsgMCBdWyB4MiBdID09IHMxIGFuZCBkcFsgMSBdWyB4MiBdID09IHQxICkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgY291dCA8PCB4MSA8PCB4MiA8PCB4MSA8PCB4MjsgcmV0dXJuIDA7IAogICAgICAgICAgICB9Cn0=