#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int main() {
  int T, i, j, ca = 0, m;
  unsigned long long a;
  while (cin >> a) {
    unsigned long long first = 45 * 18 % a;
    for (i = 0; i < 17; i++) first = first * 10 % a;
    first = (first + 1) % a;
    cout << a - first + 1 << " " << a - first + (unsigned long long)(1e18)
         << "\n";
  }
  return 0;
}
