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