// yukicoder: No.544 Delete 7 // 2019.4.20 bal4u #include #if 1 #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) #else #define gc() getchar() #define pc(c) putchar(c) #endif int ins(char *s) // 文字列の入力 スペース以下の文字で入力終了 { char *p = s; do *s = gc(); while (*s++ > ' '); *--s = 0; return s - p; } void outs(char *s) { while (*s) pc(*s++); } char A[12]; char B[12] = "00000000000"; int main() { int i, w; w = ins(A), B[w] = 0; for (i = 0; i < w; i++) { if (A[i] == '7') A[i] = '8', B[i] = '1'; } outs(A), pc(' '), pc('-'); i = 0; while (B[i] == '0') i++; outs(B+i), pc('\n'); return 0; }