#include using namespace std; int main( int argc, char *argv[] ) { int A; int B; int i; char S[ 100 ]; int X; ios::sync_with_stdio( false ); cin.tie( 0 ); A = 0; B = 0; cin >> S; i = 0; while( S[ i ] != '\0' ) { X = S[ i ] - '0'; A *= 10; B *= 10; if( X == 7 ) { A += 4; B += 3; } else A += X; i++; } cout << A << " " << B << endl; return 0; }