#include <bits/stdc++.h>
using namespace std;
const int M = 100010;
int main() {
  ios_base::sync_with_stdio(false);
  unsigned long long a, first, p[30], d = 18;
  cin >> a;
  p[0] = 1;
  for (unsigned long long i = 1; i < 30; i++) p[i] = (10 * p[i - 1]);
  first = ((5 * ((d * p[d - 1]) % a)) % a * 9) % a;
  cout << a - first << " " << p[d] - 1 + a - first << endl;
  return 0;
}
