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