#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long a, t = 1, m, k = 0;
  cin >> a;
  m = a;
  while (m) {
    k++;
    m /= 10;
  }
  m = 0;
  for (int i = 1; i <= k; i++) {
    if (m > a)
      m = m % a;
    else {
      m = ((m * 10) % a + t % a * 45 % a) % a;
    }
    t *= 10;
  }
  m = a - m;
  cout << m << ' ' << t + m - 1 << endl;
}
