#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  long long a, r, inf = 1e17;
  while (~scanf("%I64d", &a)) {
    a -= 5 * (9 * (inf * 18 % a) % a) % a;
    r = a + inf * 10 - 1;
    printf("%I64d %I64d\n", a, r);
  }
  return 0;
}
