#include <bits/stdc++.h>
using namespace std;
const int N = 200001;
long long a[N + 1], tree[4 * N], lazy[4 * N];
void build(int idx, int l, int r) {
  if (l == r)
    tree[idx] = a[l];
  else {
    int m = (l + r) / 2;
    build(2 * idx, l, m);
    build(2 * idx + 1, m + 1, r);
    tree[idx] = min(tree[2 * idx], tree[2 * idx + 1]);
  }
}
void push(int idx) {
  tree[2 * idx] += lazy[idx];
  lazy[2 * idx] += lazy[idx];
  tree[2 * idx + 1] += lazy[idx];
  lazy[2 * idx + 1] += lazy[idx];
  lazy[idx] = 0;
}
void update(int idx, int l, int r, int ql, int qr, long long val) {
  if (ql > qr) return;
  if (l == ql && r == qr) {
    tree[idx] += val;
    lazy[idx] += val;
  } else {
    push(idx);
    int m = (l + r) / 2;
    update(2 * idx, l, m, ql, min(qr, m), val);
    update(2 * idx + 1, m + 1, r, max(ql, m + 1), qr, val);
    tree[idx] = min(tree[2 * idx], tree[2 * idx + 1]);
  }
}
long long query(int idx, int l, int r, int ql, int qr) {
  if (ql > qr) return 1000000000000000000;
  if (l == ql && r == qr)
    return tree[idx];
  else {
    push(idx);
    int m = (l + r) / 2;
    return min(query(2 * idx, l, m, ql, min(qr, m)),
               query(2 * idx + 1, m + 1, r, max(ql, m + 1), qr));
  }
}
int main() {
  int n;
  scanf("%d ", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  build(1, 1, n);
  int m;
  scanf("%d ", &m);
  while (m--) {
    char c[105];
    fgets(c, 100, stdin);
    int id = 0;
    long long now[3], temp = 0;
    bool b = 0;
    for (int i = 0;; i++) {
      if (c[i] == '-') {
        b = 1;
        continue;
      }
      if (c[i] == ' ' || c[i] == '\n') {
        now[id++] = temp;
        temp = 0;
      } else
        temp = 10 * temp + (c[i] - '0');
      if (c[i] == '\n') break;
    }
    if (b) now[2] *= -1;
    now[0]++;
    now[1]++;
    if (id == 2) {
      long long res;
      if (now[0] <= now[1])
        res = query(1, 1, n, now[0], now[1]);
      else
        res = min(query(1, 1, n, 1, now[1]), query(1, 1, n, now[0], n));
      printf("%I64d\n", res);
    } else {
      if (now[0] <= now[1])
        update(1, 1, n, now[0], now[1], now[2]);
      else {
        update(1, 1, n, 1, now[1], now[2]);
        update(1, 1, n, now[0], n, now[2]);
      }
    }
  }
  return 0;
}
