#include <bits/stdc++.h>
using namespace std;
inline long long Read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long a, inf = 1E18;
signed main() {
  a = Read();
  cout << a - inf % a * 9 % a * 9 % a << ' ';
  cout << a - inf % a * 9 % a * 9 % a + inf - 1;
  return 0;
}
