#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> arr;
vector<long long> s;
vector<long long> lazy;
void build(long long id = 1, long long l = 0, long long r = n) {
  if (r - l == 1) {
    s[id] = arr[l];
    return;
  }
  long long mid = (l + r) / 2;
  build(2 * id, l, mid);
  build(2 * id + 1, mid, r);
  s[id] = min(s[2 * id], s[2 * id + 1]);
}
void update(long long id, long long l, long long r, long long v) {
  s[id] += v;
  if (r - l != 1) lazy[id] += v;
}
void push(long long id, long long l, long long r) {
  long long mid = (l + r) / 2;
  update(2 * id, l, mid, lazy[id]);
  update(2 * id + 1, mid, r, lazy[id]);
  lazy[id] = 0;
}
long long query(long long x, long long y, long long id = 1, long long l = 0,
                long long r = n) {
  if (x >= r || y <= l) {
    return LLONG_MAX;
  }
  if (x <= l && y >= r) {
    return s[id];
  }
  push(id, l, r);
  long long mid = (l + r) / 2;
  return min(query(x, y, 2 * id, l, mid), query(x, y, 2 * id + 1, mid, r));
}
void increase(long long x, long long y, long long v, long long id = 1,
              long long l = 0, long long r = n) {
  if (x >= r || y <= l) {
    return;
  }
  if (x <= l && y >= r) {
    update(id, l, r, v);
    return;
  }
  push(id, l, r);
  long long mid = (l + r) / 2;
  increase(x, y, v, 2 * id, l, mid);
  increase(x, y, v, 2 * id + 1, mid, r);
  s[id] = min(s[2 * id], s[2 * id + 1]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  arr.resize(n);
  s.resize(4 * n, LLONG_MAX);
  lazy.resize(4 * n, 0);
  for (int i = 0; i < n; ++i) {
    long long temp;
    cin >> temp;
    arr[i] = temp;
  }
  build();
  long long m;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    cin.clear();
    long long L, R;
    cin >> L >> R;
    if (cin.peek() == '\n') {
      if (L > R) {
        long long tempA = query(L, arr.size());
        long long tempB = query(0, R + 1);
        cout << min(tempA, tempB) << endl;
      } else {
        long long temp = query(L, R + 1);
        cout << temp << endl;
      }
    } else {
      long long G;
      cin >> G;
      if (L > R) {
        increase(L, arr.size(), G);
        increase(0, R + 1, G);
      } else {
        increase(L, R + 1, G);
      }
    }
  }
}
