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