#include <bits/stdc++.h>
using namespace std;
template <typename T>
T mabs(const T &a) {
  return a < 0 ? -a : a;
}
void run() {
  unsigned long long a;
  cin >> a;
  int n = 19;
  unsigned long long A = 1, here = 45 * n % a;
  for (int i = (0), ei = (n); i < ei; i++) A *= 10;
  for (int i = (0), ei = (n - 1); i < ei; i++) here = here * 10 % a;
  cout << (a - here) << ' ' << A + (a - here) - 1 << endl;
}
int main() {
  run();
  return 0;
}
