#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; 
            }
}