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