#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<long long> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
long long total_sum = accumulate(a.begin(), a.end(), 0LL);
int max_segments = 0;
vector<int> result;
for (int k = 1; k <= n; ++k) {
if (total_sum % k == 0) {
long long target_sum = total_sum / k;
int current_sum = 0;
int segments = 0;
vector<int> current_result;
for (int i = 0; i < n; ++i) {
current_sum += a[i];
if (current_sum == target_sum) {
segments++;
current_result.push_back(i + 1);
current_sum = 0;
} else if (current_sum > target_sum) {
segments = 0;
break; // Không thể chia theo ước số này
}
}
if (segments == k && segments > max_segments) {
max_segments = segments;
result = current_result;
}
}
}
if (max_segments == 0) {
cout << 1 << endl;
cout << n << endl;
} else {
cout << max_segments << endl;
for (int i = 0; i < result.size(); ++i) {
cout << result[i] << (i == result.size() - 1 ? "" : " ");
}
cout << endl;
}
return 0;
}