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