#include <bits/stdc++.h>
using namespace std;
long long N = 1e17;
int main() {
  long long a;
  cin >> a;
  a -= ((5 * ((9 * ((18 * N) % (a))) % (a))) % (a));
  cout << a << " " << a + N * 10 - 1 << endl;
  return 0;
}
