#include <bits/stdc++.h>

using namespace std;

const int NMax = 4e5 + 5;

pair < int, int > rest[NMax];
int A[NMax];
int v[NMax];

int main(){
    #ifndef ONLINE_JUDGE
    freopen("a.in", "r", stdin);
    #endif // ONLINE_JUDGE

    int n;
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> v[i];
        v[i] = v[i] % n;
        if(v[i] == 0){
            cout << "1\n" << i;
            return 0;
        }
        A[v[i]]++;
    }
    int x;
    for(int i = 1; i <= n; i++){
        x = 0;
        for(int j = 1; j <= A[i]; j++){
            x += i;
            x = x % n;
            if(rest[x].first == 0 && rest[n - x].first != i){
                rest[x] = {i, j};
            }
        }
        if(rest[0].first != 0){
            break;
        }
    }
    int a, b, need;
    if(rest[0].first == 0){
        for(int i = 1; i <= n / 2; i++){
            if(rest[i].first != 0 && rest[n - i].first != 0){
                a = i;
                b = n - i;
                break;
            }
        }
        cout << rest[a].second + rest[b].second << "\n";
        for(int i = 1; i <= n; i++){
            if(v[i] == rest[a].first && rest[a].second != 0){
                cout << i << " ";
                rest[a].second--;
            }
            if(v[i] == rest[b].first && rest[b].second != 0){
                cout << i << " ";
                rest[b].second--;
            }
        }
    } else {
        x = rest[0].first;
        need = rest[0].second;
        cout << need << "\n";
        for(int i = 1; i <= n && need; i++){
            if(v[i] == x){
                cout << i << " ";
                need--;
            }
        }
    }
    return 0;
}