#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ '0');
    c = getchar();
  }
  return x * f;
}
long long l, r, inf = 1e18, mo;
signed main() {
  mo = read();
  l = mo - inf % mo * 9 % mo * 9 % mo;
  r = l + inf - 1;
  printf("%lld %lld", l, r);
  return 0;
}
