#include <bits/stdc++.h>
using namespace std;
class edge {
 public:
  int e, nxt;
  long long w1, w2;
} g[600010];
int head[300010], ecnt = 0, dep[300010], fa[300010][19];
void addedge(int s, int e, long long w1, long long w2) {
  g[ecnt] = (edge){e, head[s], w1, w2}, head[s] = ecnt++;
  g[ecnt] = (edge){s, head[e], w1, w2}, head[e] = ecnt++;
}
long long d[300010];
class matr {
 public:
  long long dat[2][2];
  void init() { memset(dat, 0, sizeof(dat)); }
  matr operator*(const matr &t) const {
    matr ret;
    memset(ret.dat, 0x3f, sizeof(ret.dat));
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        for (int k = 0; k < 2; k++) {
          ret.dat[i][k] = min(ret.dat[i][k], dat[i][j] + t.dat[j][k]);
        }
      }
    }
    return ret;
  }
} st[300010][19];
void dfs1(int np, int fath) {
  dep[np] = dep[fath] + 1;
  for (int i = head[np]; i != -1; i = g[i].nxt) {
    if (g[i].e == fath) continue;
    dfs1(g[i].e, np);
    d[np] = min(d[np], d[g[i].e] + g[i].w1 + g[i].w2);
  }
}
void dfs2(int np, int fath) {
  for (int i = head[np]; i != -1; i = g[i].nxt) {
    if (g[i].e == fath) {
      d[np] = min(d[np], d[fath] + g[i].w1 + g[i].w2);
      break;
    }
  }
  for (int i = head[np]; i != -1; i = g[i].nxt) {
    if (g[i].e == fath) continue;
    dfs2(g[i].e, np);
  }
}
void dfs3(int np, int fath) {
  fa[np][0] = fath;
  for (int i = 1; i < 19; i++) fa[np][i] = fa[fa[np][i - 1]][i - 1];
  for (int i = head[np]; i != -1; i = g[i].nxt) {
    if (g[i].e == fath) {
      st[np][0].dat[0][0] = min(g[i].w1, g[i].w2 + d[np] + d[fath]);
      st[np][0].dat[0][1] = min(g[i].w1 + d[fath], g[i].w2 + d[np]);
      st[np][0].dat[1][0] = min(g[i].w2 + d[fath], g[i].w1 + d[np]);
      st[np][0].dat[1][1] = min(g[i].w2, g[i].w1 + d[np] + d[fath]);
      break;
    }
  }
  for (int i = 1; i < 19; i++)
    st[np][i] = st[np][i - 1] * st[fa[np][i - 1]][i - 1];
  for (int i = head[np]; i != -1; i = g[i].nxt) {
    if (g[i].e == fath) continue;
    dfs3(g[i].e, np);
  }
}
inline int lca(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  for (int i = 18; i >= 0; i--)
    if (dep[fa[x][i]] >= dep[y]) x = fa[x][i];
  if (x == y) return x;
  for (int i = 18; i >= 0; i--)
    if (fa[x][i] != fa[y][i]) x = fa[x][i], y = fa[y][i];
  return fa[x][0];
}
int n, Q;
int main() {
  memset(head, 255, sizeof(head));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &d[i]);
  for (int i = 0; i < n - 1; i++) {
    int s, e;
    long long w1, w2;
    scanf("%d%d%lld%lld", &s, &e, &w1, &w2);
    addedge(s, e, w1, w2);
  }
  dfs1(1, 0);
  dfs2(1, 0);
  dfs3(1, 0);
  scanf("%d", &Q);
  while (Q--) {
    int x, y;
    scanf("%d%d", &x, &y);
    int dx = (x + 1) & 1, dy = (y + 1) & 1;
    x = (x + 1) >> 1;
    y = (y + 1) >> 1;
    int L = lca(x, y);
    matr st1, st2;
    st1.init();
    st1.dat[0][1] = st1.dat[1][0] = d[x];
    st2.init();
    st2.dat[0][1] = st2.dat[1][0] = d[y];
    for (int i = 18; i >= 0; i--) {
      if (dep[fa[x][i]] >= dep[L]) st1 = st1 * st[x][i], x = fa[x][i];
      if (dep[fa[y][i]] >= dep[L]) st2 = st2 * st[y][i], y = fa[y][i];
    }
    long long ans = 0x3f3f3f3f3f3f3f3f;
    for (int i = 0; i < 2; i++) ans = min(ans, st1.dat[dx][i] + st2.dat[dy][i]);
    printf("%lld\n", ans);
  }
  return 0;
}
