#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, r, a, u, v = 45, temp;
  cin >> a;
  u = 45;
  int i, j;
  for (i = 0; i < 17; ++i) {
    temp = 0;
    for (j = 0; j < 10; ++j) temp = (temp + u) % a;
    for (j = 0; j < 10; ++j) temp = (temp + v) % a;
    v = (v * 10) % a;
    u = temp;
  }
  l = a - u;
  r = l + (1e18) - 1;
  cout << l << " " << r << endl;
}
