#include <bits/stdc++.h>
using namespace std;
const int sz = 450;
long long a[200005], b[455], c[455];
int n;
bool judge() {
  char c = getchar();
  while (c != ' ' && c != '\n') c = getchar();
  return c != '\n' ? true : false;
}
void work(int x) {
  int i, t = sz * x;
  b[x] = 1e17;
  for (i = 0; i < sz && t + i < n; i++) b[x] = min(b[x], a[t + i]);
}
void modify(int x, int y, long long z) {
  int i;
  for (i = x; i < (x / sz + 1) * sz && i <= y; i++) a[i] += z;
  work(x / sz);
  if (x / sz == y / sz) return;
  for (i = (y / sz) * sz; i <= y; i++) a[i] += z;
  work(y / sz);
  for (i = x / sz + 1; i * sz + sz <= y; i++) c[i] += z;
}
long long query(int x, int y) {
  int i;
  long long t = 1e17;
  for (i = x; i < (x / sz + 1) * sz && i <= y; i++)
    t = min(t, a[i] + c[i / sz]);
  if (x / sz == y / sz) return t;
  for (i = (y / sz) * sz; i <= y; i++) t = min(t, a[i] + c[i / sz]);
  for (i = x / sz + 1; i * sz + sz <= y; i++) t = min(t, b[i] + c[i]);
  return t;
}
int main() {
  int q, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%I64d", &a[i]);
  for (i = 0; i < (n / sz); i++) work(i);
  scanf("%d", &q);
  while (q--) {
    int x, y, z;
    scanf("%d%d", &x, &y);
    if (judge()) {
      scanf("%d", &z);
      if (x <= y)
        modify(x, y, (long long)z);
      else
        modify(0, y, (long long)z), modify(x, n - 1, (long long)z);
    } else
      printf("%I64d\n",
             x <= y ? query(x, y) : min(query(0, y), query(x, n - 1)));
  }
  return 0;
}
