#include <bits/stdc++.h>
using namespace std;
int f(int n) {
  int ret = 0;
  while (n > 0) {
    ret += n % 10;
    n /= 10;
  }
  return ret;
}
unsigned long long pw = 18;
unsigned long long ten[20] = {1};
int main() {
  std::ios_base::sync_with_stdio(false);
  unsigned long long a;
  cin >> a;
  for (int i = int(1); i < int(20); i++) ten[i] = ten[i - 1] * 10;
  unsigned long long r = (ten[pw - 1] % a * 45 % a * pw % a + 1) % a;
  r = (a - r) % a;
  cout << r + 1 << " " << ten[pw] + r << endl;
  return 0;
}
