#include <bits/stdc++.h>
using namespace std;
template <typename T, typename T1>
ostream &operator<<(ostream &out, pair<T, T1> obj) {
  out << "(" << obj.first << "," << obj.second << ")";
  return out;
}
template <typename T, typename T1>
ostream &operator<<(ostream &out, map<T, T1> cont) {
  typename map<T, T1>::const_iterator itr = cont.begin();
  typename map<T, T1>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, set<T> cont) {
  typename set<T>::const_iterator itr = cont.begin();
  typename set<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, multiset<T> cont) {
  typename multiset<T>::const_iterator itr = cont.begin();
  typename multiset<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
  return out;
}
template <typename T,
          template <typename ELEM, typename ALLOC = allocator<ELEM>> class CONT>
ostream &operator<<(ostream &out, CONT<T> cont) {
  typename CONT<T>::const_iterator itr = cont.begin();
  typename CONT<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
  return out;
}
template <typename T, unsigned int N, typename CTy, typename CTr>
typename enable_if<!is_same<T, char>::value, basic_ostream<CTy, CTr> &>::type
operator<<(basic_ostream<CTy, CTr> &out, const T (&arr)[N]) {
  for (auto i = 0; i < N; ++i) out << arr[i] << " ";
  out << endl;
  return out;
}
template <typename T>
T gcd(T a, T b) {
  T min_v = min(a, b);
  T max_v = max(a, b);
  while (min_v) {
    T temp = max_v % min_v;
    max_v = min_v;
    min_v = temp;
  }
  return max_v;
}
template <typename T>
T lcm(T a, T b) {
  return (a * b) / gcd(a, b);
}
template <typename T>
T fast_exp_pow(T base, T exp, T mod) {
  long long res = 1;
  while (exp) {
    if (exp & 1) {
      res *= base;
      res %= mod;
    }
    exp >>= 1;
    base *= base;
    base %= mod;
  }
  return res % mod;
}
int N, M;
bool check;
long long val_1, val_2, val_3, ret;
long long numbers[200010], seg_tree[4 * 200010], lazy[4 * 200010];
string line;
void get_input() {
  int pos = 0;
  bool neg = false;
  check = false;
  val_1 = val_2 = val_3 = 0;
  while (pos < line.size()) {
    if (line[pos] == ' ') break;
    val_1 = val_1 * 10 + line[pos++] - '0';
  }
  ++pos;
  while (pos < line.size()) {
    if (line[pos] == ' ') break;
    val_2 = val_2 * 10 + line[pos++] - '0';
  }
  ++pos;
  while (pos < line.size()) {
    if (line[pos] == ' ') break;
    check = true;
    if (line[pos] == '-')
      neg = true;
    else
      val_3 = val_3 * 10 + line[pos] - '0';
    ++pos;
  }
  if (neg) val_3 = -val_3;
}
void build(int Tbeg = 0, int Tend = N - 1, int ind = 0) {
  if (Tbeg == Tend) {
    seg_tree[ind] = numbers[Tbeg];
    return;
  }
  int Tmid = (Tbeg + Tend) >> 1;
  build(Tbeg, Tmid, 2 * ind + 1);
  build(Tmid + 1, Tend, 2 * ind + 2);
  seg_tree[ind] = min(seg_tree[2 * ind + 1], seg_tree[2 * ind + 2]);
}
int query(int Qbeg, int Qend, int Tbeg = 0, int Tend = N - 1, int ind = 0) {
  if (lazy[ind] != 0) {
    seg_tree[ind] += lazy[ind];
    if (Tbeg != Tend) {
      lazy[2 * ind + 1] += lazy[ind];
      lazy[2 * ind + 2] += lazy[ind];
    }
    lazy[ind] = 0;
  }
  if (Tend < Qbeg || Tbeg > Qend) return INT_MAX;
  if (Tbeg >= Qbeg && Tend <= Qend) return seg_tree[ind];
  int Tmid = (Tbeg + Tend) >> 1;
  int ret_1 = query(Qbeg, Qend, Tbeg, Tmid, 2 * ind + 1);
  int ret_2 = query(Qbeg, Qend, Tmid + 1, Tend, 2 * ind + 2);
  return min(ret_1, ret_2);
}
void update(int Qbeg, int Qend, int val, int Tbeg = 0, int Tend = N - 1,
            int ind = 0) {
  if (lazy[ind] != 0) {
    seg_tree[ind] += lazy[ind];
    if (Tbeg != Tend) {
      lazy[2 * ind + 1] += lazy[ind];
      lazy[2 * ind + 2] += lazy[ind];
    }
    lazy[ind] = 0;
  }
  if (Tend < Qbeg || Tbeg > Qend) return;
  if (Tbeg >= Qbeg && Tend <= Qend) {
    seg_tree[ind] += val;
    if (Tbeg != Tend) {
      lazy[2 * ind + 1] += val;
      lazy[2 * ind + 2] += val;
    }
    return;
  }
  int Tmid = (Tbeg + Tend) >> 1;
  update(Qbeg, Qend, val, Tbeg, Tmid, 2 * ind + 1);
  update(Qbeg, Qend, val, Tmid + 1, Tend, 2 * ind + 2);
  seg_tree[ind] = min(seg_tree[2 * ind + 1], seg_tree[2 * ind + 2]);
}
int main() {
  scanf("%d", &N);
  for (auto i = 0; i < N; ++i) scanf("%lld", numbers + i);
  build();
  scanf("%d", &M);
  cin.ignore();
  while (M--) {
    getline(cin, line);
    get_input();
    if (check) {
      if (val_1 <= val_2)
        update(val_1, val_2, val_3);
      else {
        update(val_1, N - 1, val_3);
        update(0, val_2, val_3);
      }
    } else {
      if (val_1 <= val_2)
        ret = query(val_1, val_2);
      else
        ret = min(query(val_1, N - 1), query(0, val_2));
      printf("%lld\n", ret);
    }
  }
}
