#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVI; typedef vector VVL; typedef pair P; typedef pair PL; int main() { ll x, a = 0, b; cin >> x; ll y = x; REP(i,10){ if (y % 10 == 7){ ll p = 1; REP(j,i) p *= 10; a += p; } y /= 10; if (y == 0) break; } b = x - a; cout << a << " " << b << endl; return 0; }