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;
ifstream fin("input.txt");
ofstream fout("output.txt");
int gcd(int a, int b) {
  while (a && b) a > b ? a %= b : b %= a;
  return a + b;
}
int val(char c) {
  if (c >= '0' && c <= '9')
    return (int)c - '0';
  else
    return (int)c - 'A' + 10;
}
long long pows(int a, int b) {
  long long res = 1;
  for (int i = 0; i < b; ++i) {
    res *= a;
  }
  return res;
}
long long logx(long long base, long long num) {
  int cnt = 0;
  while (num != 1) {
    num /= base;
    ++cnt;
  }
  return cnt;
}
long long divisibles(long long a, long long b, long long m) {
  if (a % m == 0)
    return (b / m) - (a / m) + 1;
  else
    return (b / m) - (a / m);
}
vector<int> root(100001, 0);
vector<int> size(100001, 0);
int find(int x) {
  while (x != root[x]) x = root[x];
  return x;
}
bool same(int a, int b) { return find(a) == find(b); }
void unite(int a, int b) {
  a = find(a);
  b = find(b);
  if (size[a] < size[b]) swap(a, b);
  size[a] += size[b];
  root[b] = a;
}
vector<int> dp(1000001, INT_MAX);
set<int> quasi;
vector<int> vecx;
string s = "";
void generator(string s) {
  string x = s;
  string y = s;
  if (s.size() == 8) return;
  if (s.size()) {
    long long x = stol(s);
    if (x > 1000000) return;
    if (x) {
      quasi.insert(x);
      dp[x] = 1;
    }
  }
  generator(x += '1');
  generator(y += '0');
}
int dpx(int n) {
  if (n < 0) return INT_MAX;
  if (dp[n] != INT_MAX) return dp[n];
  for (int i = 0; i < vecx.size(); ++i) {
    if (n - vecx[i] < 0) break;
    dp[n] = min(dpx(n - vecx[i]), dp[n]);
  }
  return ++dp[n];
}
int main() {
  std::ios::sync_with_stdio(false);
  generator(s);
  vector<int> ans;
  int n;
  cin >> n;
  for (auto x : quasi) vecx.push_back(x);
  dpx(n);
  while (n) {
    if (dp[n] == 1) {
      ans.push_back(n);
      n = 0;
      break;
    }
    int mini = INT_MAX;
    for (int i = 0; i < vecx.size(); ++i) {
      if (n - vecx[i] < 0) break;
      mini = min(dp[n - vecx[i]], mini);
    }
    for (int i = 0; i < vecx.size(); ++i) {
      if (n - vecx[i] < 0) break;
      if (mini == dp[n - vecx[i]]) {
        n -= vecx[i];
        ans.push_back(vecx[i]);
        break;
      }
    }
  }
  cout << ans.size() << "\n";
  for (auto x : ans) cout << x << " ";
}
