#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long sum = 45 * 17 * 10000000000000000LL + 1;
  unsigned long long right = 100000000000000000LL;
  unsigned long long mod;
  cin >> mod;
  unsigned long long left_over = sum % mod;
  cout << mod - left_over + 1 << " " << mod - left_over + right << endl;
  return 0;
}
