#include <bits/stdc++.h>
template <typename T>
void read(T &);
template <typename T>
void write(const T &);
const int iinf = 2147483647;
const long long llinf = 9223372036854775807ll;
const int N = 300005;
const int M = 20;
void getw(int u, int fa);
void dfs(int u);
long long query(int u, int v);
std::vector<std::tuple<int, long long, long long> > G[N];
int fa[N][M];
long long val[N][M][2][2];
int lg2[N];
int dep[N];
long long a[N], w[N];
int n, q;
int main() {
  read(n);
  for (int i = 2; i <= n; ++i) lg2[i] = lg2[i >> 1] + 1;
  for (int i = 1; i <= n; ++i) read(a[i]), w[i] = a[i];
  for (int i = 1; i < n; ++i) {
    int u, v;
    long long w1, w2;
    read(u), read(v), read(w1), read(w2);
    G[u].emplace_back(v, w1, w2);
    G[v].emplace_back(u, w1, w2);
  }
  getw(1, 0), getw(1, 0);
  dfs(1);
  read(q);
  while (q--) {
    int u, v;
    read(u), read(v);
    write(query(u, v)), putchar('\n');
  }
  return 0;
}
long long query(int u, int v) {
  int su = (u & 1) ^ 1, sv = (v & 1) ^ 1;
  u = (u + 1) >> 1, v = (v + 1) >> 1;
  if (dep[u] < dep[v]) std::swap(u, v), std::swap(su, sv);
  long long au[2], av[2];
  au[su] = 0, au[su ^ 1] = w[u];
  av[sv] = 0, av[sv ^ 1] = w[v];
  int diff = dep[u] - dep[v];
  for (int i = 0; i <= 18; ++i) {
    if (diff >> i & 1) {
      long long nau[2];
      for (int j = 0; j < 2; ++j)
        nau[j] =
            std::min(au[j] + val[u][i][j][j], au[j ^ 1] + val[u][i][j ^ 1][j]);
      std::swap(au, nau);
      u = fa[u][i];
    }
  }
  if (u != v) {
    for (int i = 18; i >= 0; --i) {
      if (fa[u][i] != fa[v][i]) {
        long long nau[2], nav[2];
        for (int j = 0; j < 2; ++j) {
          nau[j] = std::min(au[j] + val[u][i][j][j],
                            au[j ^ 1] + val[u][i][j ^ 1][j]);
          nav[j] = std::min(av[j] + val[v][i][j][j],
                            av[j ^ 1] + val[v][i][j ^ 1][j]);
        }
        std::swap(au, nau), std::swap(av, nav);
        u = fa[u][i], v = fa[v][i];
      }
    }
    long long nau[2], nav[2];
    for (int j = 0; j < 2; ++j) {
      nau[j] =
          std::min(au[j] + val[u][0][j][j], au[j ^ 1] + val[u][0][j ^ 1][j]);
      nav[j] =
          std::min(av[j] + val[v][0][j][j], av[j ^ 1] + val[v][0][j ^ 1][j]);
    }
    std::swap(au, nau), std::swap(av, nav);
    u = fa[u][0], v = fa[v][0];
  }
  return std::min(au[0] + av[0], au[1] + av[1]);
}
void getw(int u, int fa) {
  for (auto [v, w1, w2] : G[u]) {
    if (v == fa) continue;
    w[v] = std::min(w[v], w[u] + w1 + w2);
    getw(v, u);
    w[u] = std::min(w[u], w[v] + w1 + w2);
  }
}
void dfs(int u) {
  for (int i = 1; i <= lg2[dep[u]]; ++i) {
    fa[u][i] = fa[fa[u][i - 1]][i - 1];
    for (int j = 0; j < 2; ++j) {
      for (int k = 0; k < 2; ++k) {
        val[u][i][j][k] = llinf;
        for (int l = 0; l < 2; ++l) {
          val[u][i][j][k] =
              std::min(val[u][i][j][k],
                       val[u][i - 1][j][l] + val[fa[u][i - 1]][i - 1][l][k]);
        }
      }
    }
  }
  for (auto [v, w0, w1] : G[u]) {
    if (v == fa[u][0]) continue;
    fa[v][0] = u;
    dep[v] = dep[u] + 1;
    val[v][0][0][0] = std::min(w0, w1 + w[u] + w[v]);
    val[v][0][1][1] = std::min(w1, w0 + w[u] + w[v]);
    val[v][0][0][1] = std::min(w0 + w[u], w1 + w[v]);
    val[v][0][1][0] = std::min(w0 + w[v], w1 + w[u]);
    dfs(v);
  }
}
template <typename T>
void read(T &Re) {
  T k = 0;
  char ch = getchar();
  int flag = 1;
  while (!(ch >= '0' && ch <= '9')) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while ((ch >= '0' && ch <= '9')) k = k * 10 + ch - '0', ch = getchar();
  Re = flag * k;
}
template <typename T>
void write(const T &Wr) {
  if (Wr < 0) {
    putchar('-'), write(-Wr);
  } else if (Wr < 10) {
    putchar(Wr + '0');
  } else {
    write(Wr / 10), putchar((Wr % 10) + '0');
  }
}
