#include using namespace std; typedef long long ll; #define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i) templatebool chmin(T&a,const T&b){return a>b?(a=b,true):false;} templatebool chmax(T&a,const T&b){return a 0) { int d = N % 10; int a = 1; int b = d - 1; while (a == 7 || b == 7) { a++; b--; } N /= 10; A += a * k; B += b * k; k *= 10; } cout << A << " " << B << endl; return 0; } int main() { for (;!cin.eof();cin>>ws) main2(); return 0; }