#include #include #include #include int main() { std::string n; std::cin >> n; int A = 0; int B = 0; for (int i = 0; i < n.size(); i++) { if (n[i] == '7') { A = 10 * A + 1; B = 10 * B + 6; } else { A = 10 * A + (n[i] - '0'); B = 10 * B + 0; } } std::cout << A << ' ' << B << std::endl; }