#include <bits/stdc++.h>
int n, q;
using namespace std;

int main()
{
    cin >> n >> q;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    while(q--){
        int l, r;
        cin >> l >> r;
        cout << 0 << endl;
        
    }
    return 0;
}