111111
 100009
 10011
 1000000
 8
 10201
 102030
 908172
 123456
 415
 900000
 21
 909090
 314159
 999999
 909823
 987654
 1453
 1435
 98
 10
 2
 1

1
111111
 9
100001 1 1 1 1 1 1 1 1
 1
10011
 1
1000000
 8
1 1 1 1 1 1 1 1
 2
10101 100
 3
101010 1010 10
 9
101111 101011 101010 101010 101010 101010 101010 101000 100000
 6
111111 11111 1111 111 11 1
 5
111 101 101 101 1
 9
100000 100000 100000 100000 100000 100000 100000 100000 100000
 2
11 10
 9
101010 101010 101010 101010 101010 101010 101010 101010 101010
 9
111111 101011 101011 1011 11 1 1 1 1
 9
111111 111111 111111 111111 111111 111111 111111 111111 111111
 9
101111 101111 101101 101100 101100 101100 101100 101100 101000
 9
111111 111111 111111 111111 111110 111100 111000 110000 100000
 5
1111 111 111 110 10
 5
1111 111 111 101 1
 9
11 11 11 11 11 11 11 11 10
 1
10
 2
1 1
 1
1

#include <bits/stdc++.h>
using namespace std;
template <class T>
inline pair<T, T> extendedEuclid(T a, T b) {
  if (b == 0)
    return pair<T, T>(1, 0);
  else {
    pair<T, T> d = extendedEuclid(b, a % b);
    return pair<T, T>(d.second, d.first - d.second * (a / b));
  }
}
template <class T>
inline T modularInverse(T a, T M) {
  pair<T, T> ret = extendedEuclid(a, M);
  return ((ret.first % M) + M) % M;
}
template <class T>
inline T bigMod(T p, T e, T M) {
  long long ret = 1;
  while (e > 0) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
    e >>= 1;
  }
  return (T)ret;
}
template <class T>
inline T power(T p, T e) {
  long long ret = 1;
  while (e > 0) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
    e >>= 1;
  }
  return (T)ret;
}
template <class T>
inline string tostring(T n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
template <class T>
inline T toint(T n) {
  T ret;
  stringstream s(n);
  s >> ret;
  return ret;
}
void nCr(vector<long long>& vc, int st, int ed, long long sum, long long A[]) {
  if (st == ed) {
    vc.push_back(sum);
    return;
  }
  for (long long i = 0; i <= 2; i++) {
    nCr(vc, st + 1, ed, sum + A[st] * i, A);
  }
}
struct SM {
  long long a, b, c, d;
  SM(long long _a = 0, long long _b = 0, long long _c = 0, long long _d = 0) {
    a = _a;
    b = _b;
    c = _c;
    d = _d;
  }
};
struct comp {
  bool operator()(const SM& u, const SM& v) { return u.a > v.a; }
};
struct com {
  bool operator()(const int& l, const int& r) { return l > r; }
};
priority_queue<SM, vector<SM>, comp> pq;
vector<int> vc;
void dfs(int n, int c) {
  if (c >= 9) return;
  if (n != 0) vc.push_back(n);
  dfs(n * 10, c + 1);
  dfs(n * 10 + 1, c + 1);
  return;
}
vector<pair<int, int> > p;
int cou = 0, f1 = INT_MAX;
int f(int n, int st) {
  int i = st;
  while (n) {
    for (i; i >= 0; i--) {
      if (n / vc[i] > 0) {
        int a = n / vc[i];
        cou += a;
        if (binary_search(vc.begin(), vc.end(), n % vc[i])) {
          cou++;
          return cou;
        }
        n %= vc[i];
      }
    }
  }
  return cou;
}
int ff(int n, int st) {
  int i = st;
  while (n) {
    for (; i >= 0; i--) {
      if (n / vc[i] > 0) {
        int a = n / vc[i];
        p.push_back({a, vc[i]});
        cou += a;
        if (binary_search(vc.begin(), vc.end(), n % vc[i])) {
          p.push_back({1, n % vc[i]});
          cou++;
          n = 0;
          return 0;
        }
        n %= vc[i];
      }
    }
  }
  return 0;
}
int n;
void fun() {
  dfs(1, 0);
  sort(vc.begin(), vc.end());
  return;
}
int main() {
  fun();
  cin >> n;
  if (n <= 9) {
    cout << n << endl;
    for (int i = (0); i < (n); i++) cout << "1 ";
    return 0;
  }
  int st;
  for (int i = 0; i < vc.size(); i++) {
    cou = 0;
    int r = f(n, i);
    if (r < f1) {
      f1 = r;
      st = i;
    }
  }
  cou = 0;
  ff(n, st);
  cout << cou << endl;
  for (int i = 0; i < p.size(); i++) {
    for (int j = 0; j < p[i].first; j++) {
      cout << p[i].second << " ";
    }
  }
  return 0;
}
