#include <bits/stdc++.h>
using namespace std;
const unsigned long long maxn = 1e18;
unsigned long long mod;
unsigned long long make() {
  unsigned long long ans = 45;
  ans *= 18;
  for (int i = 1; i <= 17; i++) ans = (ans * 10) % mod;
  return ans;
}
int main() {
  cin >> mod;
  unsigned long long tmp = make();
  unsigned long long need = mod - tmp;
  cout << need << " " << maxn + need - 1 << endl;
  return 0;
}
