#include #include #include using namespace std; int main() { int n, a[10] = {}; cin >> n; int i = 1, t = n; do { if (t % 10 == 7) { a[i] = 1; } i++; t = t / 10; } while (t != 0); int b = 0, c = 0; for (int k = 1; k < 10; k++) { if (a[k]>0) { b += (int)pow(10, k - 1); } } c = n - b; cout << b << " " << c << endl; return 0; }