#include <bits/stdc++.h>
using namespace std;
int sd(long long u) {
  int ret = 0;
  while (u) {
    ret += u % 10;
    u /= 10;
  }
  return ret;
}
long long get(long long a) {
  int d = 0;
  long long aux2 = 1;
  while (aux2 <= a) {
    aux2 *= 10;
    d++;
  };
  long long p10 = 1;
  long long ret = 0;
  long long aux = a;
  for (int i = 0; i < d; i++) {
    long long cy = a / (p10 * 10);
    int dig = aux % 10;
    aux /= 10;
    ret += cy * p10 * 45;
    for (int j = 0; j < dig; j++) ret += p10 * j;
    ret += (long long)dig * (1 + a % p10);
    p10 *= 10;
  }
  return ret;
}
int main() {
  long long n;
  scanf("%I64d", &n);
  long long low = 1, up = 100000000000000000LL;
  while (low != up) {
    long long mid = (low + up + 1) / 2;
    long long y = get(mid);
    ;
    if (y <= n)
      low = mid;
    else
      up = mid - 1;
  }
  long long a = 1, b = low;
  long long S = get(low);
  while (S != n) {
    while (S < n) {
      b++;
      S += sd(b);
    }
    while (S > n) {
      S -= sd(a);
      a++;
    }
  }
  printf("%I64d %I64d\n", a, b);
}
