#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
int main() {
  long long x;
  cin >> x;
  long long t = x - (9 * ((9 * INF) % x) % x + 1) % x;
  cout << t + 1 << " " << t + INF << endl;
  return 0;
}
