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