#include #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; int main() { string s; cin >> s; string a, b; for (char c : s) { if (c == '7') { a += '3'; b += '4'; } else { a += '0'; b += c; } } while (a.front() == '0')a = a.substr(1); while (b.front() == '0')b = b.substr(1); cout << a << ' ' << b << endl; }