#include int main() { long long int n; scanf("%lld", &n); long long int a, b, c; for (a = n, b = 0, c = 1; c < 1e10; c *= 10) { if (a / c % 10 == 7) { a -= c; b += c; } } printf("%lld %lld\n", a, b); return 0; }