#include #include int getrand(int min, int max) { return min + (int)(rand() * (max - min + 1.0) / (1.0 + RAND_MAX)); } int contain7(int n) { while (n != 0) { if (n % 10 == 7 || n % 10 == -7) return 1; n = (n - n % 10) / 10; } return 0; } int main() { int n; scanf("%d", &n); int a, b; while (1) { a = getrand(-1e9, 1e9); b = n - a; if (!(-1e9 <= b && b <= 1e9)) continue; if (!contain7(a) && !contain7(b)) break; } printf("%d %d\n", a, b); return 0; }