#include <bits/stdc++.h>
namespace QiFeng233 {
long long a, l, r, b;
void solve() {
  scanf("%lld", &a);
  b = ((long long)1e18 % a * 9 % a * 9 % a + 1 % a) % a;
  printf("%lld %lld", 1 + a - b, (long long)1e18 + a - b);
}
}  // namespace QiFeng233
signed main() {
  QiFeng233::solve();
  return 0;
}
