#include #include using namespace std; int N, A[1009], K; int main() { cin >> K; int minx = 10000; for (int i = 0; i <= 140; i++) { for (int j = 0; j <= 140; j++) { for (int k = 0; k <= 140; k++) { if (j*k + i*(i - 1) / 2 != K) continue; if (minx > i + j + k) { minx = i + j + k; for (int l = 0; l < i; l++) A[l] = 1; for (int l = i; l < i + j; l++) A[l] = 3; for (int l = i + j; l < i + j + k; l++) A[l] = 8; } } } } cout << minx << endl; for (int i = 0; i < minx; i++) { if (i)cout << " "; cout << A[i]; }cout << endl; return 0; }