#include <bits/stdc++.h>
using namespace std;
long long a, N = 1e18 + 1;
signed main() {
  scanf("%lld", &a);
  long long l = a - N % a * 9 % a * 9 % a, r = N + l - 1;
  printf("%lld %lld", l, r);
  return 0;
}
