#include #include using namespace std; bool check(int n) { int keta = 0; for (int i = n; i > 0; i /= 10)keta++; bool flag = true; for (int k = keta; k >= 1; k--) { if (n / (int)(pow(10, k - 1)) % 10 == 7)flag = false; } return flag; } int main() { int n; cin >> n; for (int a = 1; true; a++) { int b = n - a; if (check(a) && check(b)) { cout << a << " " << b << endl; break; } } }