#include <bits/stdc++.h>
using namespace std;
long long a;
long long tot;
int main() {
  cin >> a;
  long long p = (long long)(1e17) % a;
  for (int i = 1; i <= 18; i++) {
    for (int j = 0; j <= 9; j++) {
      tot = (tot + p * j) % a;
    }
  }
  tot++;
  cout << 1 + a - tot << ' ' << (long long)(1e18) + a - tot << endl;
  return 0;
}
