#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long ret = 0, f = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (isdigit(c)) {
    ret = ret * 10 + c - 48;
    c = getchar();
  }
  if (f) return -ret;
  return ret;
}
long long l, r, inf = 1e18, mod;
signed main() {
  scanf("%lld", &mod);
  l = mod - inf % mod * 9 % mod * 9 % mod;
  r = l + inf - 1;
  printf("%lld %lld\n", l, r);
}
