#include #include using namespace std; int main() { string n; cin >> n; string a, b; for (auto c : n) { if (c == '7') { a += '6'; b += '1'; } else { a += c; b += '0'; } } cout << stoi(a) << " " << stoi(b) << endl; return 0; }