#include <bits/stdc++.h>
using namespace std;
unsigned long long a = 1e9;
int main() {
  long long tmp;
  cin >> tmp;
  long long l = tmp - a % tmp * a % tmp * 9 % tmp * 9 % tmp;
  cout << l << " ";
  cout << l + a * a - 1 << endl;
  return 0;
}
