#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e17;
const long long MOD = 1000000007;
const long long MAX = 1000001;
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  }
  return b;
}
long long min(long long a, long long b) {
  if (a > b) {
    return b;
  }
  return a;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  if (a < b) {
    return gcd(b, a);
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
struct edge {
  long long ind;
  long long to;
  long long d;
};
long long p(long long n) {
  if (n == 0) {
    return 1;
  } else {
    return 10 * p(n - 1);
  }
}
double s(long long n) {
  long long k = 0;
  for (long long m = n; m > 0; m /= 10) {
    k += m % 10;
  }
  return n / k;
}
int main() {
  long long X;
  cin >> X;
  vector<long long> snuke;
  for (int K = 0; K < 15; K++) {
    long long i;
    if (9 * K < 10) {
      i = max(K - 1, 0);
    } else if (9 * K < 100) {
      i = K - 2;
    } else {
      i = K - 3;
    }
    for (long long x = 2 * p(K) - 1; x < p(K + 1); x += p(i)) {
      snuke.push_back(x);
    }
  }
  long long M = snuke.size();
  cout << M << endl;
  vector<bool> real(M, 0);
  long double v = INF;
  for (long long i = M - 1; i >= 0; i--) {
    if (s(snuke[i]) <= v) {
      real[i] = 1;
      v = s(snuke[i]);
    }
  }
  long long c = 0;
  for (int i = 0; i < M; i++) {
    if (real[i] == 1) {
      cout << snuke[i] << endl;
      c++;
      if (c == X) {
        break;
      }
    }
  }
  system("PAUSE");
}
