#include <bits/stdc++.h>
using namespace std;
long long s(long long n) {
  long long res = 0;
  while (n) {
    res += n % 10;
    n /= 10;
  }
  return res;
}
long long pows(long long i, long long a) {
  long long res = 1;
  while (i) {
    res *= a;
    i--;
  }
  return res;
}
int main() {
  long long a, b, c;
  cin >> a >> b >> c;
  vector<long long> v;
  for (long long i = 1;; i++) {
    double cur = clock() / CLOCKS_PER_SEC;
    if (cur >= 5) break;
    long long res = pows(a, i) * b + c;
    if (res < 1000000000) {
      if (res > 0) {
        long long sres = s(res);
        if (sres == i) {
          v.push_back(res);
        }
      }
    } else
      break;
    if (i == 1000000) break;
  }
  if (v.size()) sort(v.begin(), v.end());
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << ' ';
  return 0;
}
