#include using namespace std; using ll = long long; bool check7(int x) { while (x > 0) { int r = x % 10; if (r == 7) { return true; } x /= 10; } return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; int A = 0; int B; while (true) { A++; B = N - A; if (!check7(A) && !check7(B)) { cout << A << " " << B << endl; return 0; } } return 0; }