#include <bits/stdc++.h>
using namespace std;
long long dp[18];
int main() {
  dp[0] = 0;
  long long k = 1;
  for (int i = 1; i < 18; i++) {
    dp[i] = dp[i - 1] * 10 + 45 * k;
    k *= 10;
  }
  for (int i = 0; i < 18; i++) {
    dp[i]++;
  }
  while (cin >> k) {
    long long ans = k - dp[17] % k;
    cout << ans + 1 << " " << ans + 100000000000000000ll << endl;
  }
}
