#include <bits/stdc++.h>
using namespace std;
int main() {
  long long k, digit = 1, sum, temp;
  cin >> k;
  for (int i = 1; i <= k; i++) {
    if (digit * 10 == i) digit *= 10;
    sum = 0;
    temp = digit;
    while (1) {
      sum += i / temp % 10;
      if (temp == 1) break;
      temp /= 10;
    }
    if (i % sum == 0) cout << i << endl;
  }
  return 0;
}
