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