#include using namespace std; typedef long long ll; #define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i) #define ALL(v) (v).begin(),(v).end() #define CLR(t,v) memset(t,(v),sizeof(t)) templateostream& operator<<(ostream& os,const pair&a){return os<<"("<void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<void chmin(T&a,const T&b){if(a>b)a=b;} templatevoid chmax(T&a,const T&b){if(a> N; ll A = 0, B = 0; ll t = 1; while (N > 0) { int d = N % 10; N /= 10; if (d == 7) { A += t * 1; B += t * 6; } else { A += t * d; B += t * 0; } t *= 10; } cout << A << " " << B << endl; return 0; } int main() { for (;!cin.eof();cin>>ws) main2(); return 0; }