#include #define rep(i,a,b) for(int i=a;i=b;i--) #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),(x).end() #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> K; vector ans; int ma = -1; int x, y; rep(a, 1, K + 1) { int b = K / a; if (a + b <= 100) { if (chmax(ma, a * b)) { x = a; y = b; } } } K -= ma; rep(i, 0, x) ans.push_back(4); rep(i, 0, y) ans.push_back(9); if (K) { int mi = inf; int x, y; rep(a, 1, K + 1) if(K % a == 0) { int b = K / a; if (chmin(mi, a + b)) { x = a; y = b; } } rep(i, 0, x) ans.push_back(6); rep(i, 0, y) ans.push_back(11); } int n = ans.size(); printf("%d\n", n); rep(i, 0, n) { if (i) printf(" "); printf("%d", ans[i]); } printf("\n"); }