#include <bits/stdc++.h>   using namespace std;   int search(int a[], int x, int n) {     int lo = 0;     int hi = n;     while (lo <= hi) {       int mid = (lo + hi) / 2;       if (a[mid] >= x && a[mid - 1] < x)         return mid;       else if (a[mid] > x)         hi = mid - 1;       else         lo = mid + 1;     }     return 0;   }   int main() {     int n, m;     int a[100000];     cin >> n;     for (int i = 0; i < n; i++) {       cin >> a[i];     }     cin >> m;     int b[100000];     int ans[100000];     for (int i = 0; i < m; i++) {       cin >> b[i];     }     for (int i = 1; i < n; i++) {       a[i] += a[i - 1];     }     for (int i = 0; i < m; i++) {       ans[i] = search(a, b[i], n);     }     for (int i = 0; i < m; i++) {       cout << ans[i] + 1 << endl;     }   }   