#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long a;
  cin >> a;
  unsigned long long pw = 1;
  for (int i = 0; i < 17; i++) pw *= 10;
  unsigned long long gx = ((((pw % a) * 45) % a) * 18) % a;
  pw *= 10;
  cout << a - gx << " " << a - gx + pw - 1 << endl;
  return 0;
  ;
}
