#include using namespace std; int main () { ios::sync_with_stdio(false); int n; while ( cin >> n ) { long long prev, dif = 0, start; cin >> prev; for ( int i = 1; i < n; ++i ) { long long x; cin >> x; if ( prev + dif != x ) { dif = x - prev; start = i; } prev = x; } cout << start << endl; } return 0; }