#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char *argv[]) {
  unsigned long long a;
  cin >> a;
  unsigned long long sum_digits =
      ((19 * (1000000000000000000ull % a) % a) * 45) % a;
  cout << a - sum_digits << " "
       << a - sum_digits + (10000000000000000000ull - 1) << endl;
  return 0;
}
