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