#include //#include using namespace std ; int v[ 4 * 100000 ] ; int p[ 4 * 100000 ] ; int main() { // freopen("input.in" , "r", stdin) ; cin.sync_with_stdio(false); cout.sync_with_stdio(false); int i , j ; int n ; cin >> n ; for ( i = 1 ; i <= n ; i ++ ) { cin >> v[ i ] ; v [ i ] = ( v[ i ] + v [ i -1 ] ) % n ; if ( p[ v[ i ] ] || !v[ i ] ) break; p [ v [ i ] ] = i ; } cout<< i - p[ v[ i ] ] << '\n' ; for( j = p[ v [ i ] ] + 1 ; j <= i ; j ++ ) cout << j << ' ' ; return 0 ; }