#include <bits/stdc++.h>
using namespace std;
const int Nmax = 6e5 + 5;
const long long inf = 1e18;
long long teleport[Nmax], ans[Nmax];
vector<int> v[Nmax];
vector<pair<long long, long long> > edge[Nmax];
int n;
struct qry {
  int x, y;
  bool t1, t2;
  int id;
};
void min_to(long long &x, long long y) {
  if (x > y) x = y;
}
namespace prepare {
void dfs01(int node, int dad = 0) {
  int i;
  for (i = 0; i < v[node].size(); ++i)
    if (v[node][i] != dad) {
      dfs01(v[node][i], node);
      min_to(teleport[node],
             teleport[v[node][i]] + edge[node][i].first + edge[node][i].second);
    }
}
void dfs02(int node, int dad = 0) {
  int i;
  for (i = 0; i < v[node].size(); ++i)
    if (v[node][i] != dad) {
      min_to(teleport[v[node][i]],
             teleport[node] + edge[node][i].first + edge[node][i].second);
      dfs02(v[node][i], node);
    }
}
void compute_teleport() {
  vector<int> ord;
  int i;
  for (i = 1; i <= n; ++i) ord.push_back(i);
  dfs01(1);
  dfs02(1);
}
}  // namespace prepare
namespace centroid_decomp {
static int All, where[Nmax], w[Nmax];
static bool used[Nmax];
static long long dp[Nmax][2][2];
void dfs0(int node, int dad = 0) {
  w[node] = 1;
  for (auto it : v[node])
    if (it != dad && !used[it]) {
      dfs0(it, node);
      w[node] += w[it];
    }
}
pair<int, int> centroid(int node, int dad = 0) {
  int up = All - w[node];
  pair<int, int> ans = {Nmax, Nmax};
  for (auto it : v[node])
    if (it != dad && !used[it]) {
      ans = min(ans, centroid(it, node));
      up = max(up, w[it]);
    }
  ans = min(ans, {up, node});
  return ans;
}
void dfs(int node, int dad) {
  int i, j;
  for (i = 0; i < v[node].size(); ++i)
    if (!used[v[node][i]] && v[node][i] != dad) {
      int son = v[node][i];
      if (!dad)
        where[son] = i;
      else
        where[son] = where[node];
      for (j = 0; j < 2; ++j) {
        dp[son][j][0] = dp[node][j][0] + edge[node][i].first;
        dp[son][j][1] = dp[node][j][1] + edge[node][i].second;
        min_to(dp[son][j][0], dp[son][j][1] + teleport[son]);
        min_to(dp[son][j][1], dp[son][j][0] + teleport[son]);
      }
      dfs(son, node);
    }
}
void solve(int node, vector<qry> &Q) {
  dfs0(node);
  All = w[node];
  node = centroid(node).second;
  dp[node][0][0] = dp[node][1][1] = 0;
  dp[node][0][1] = dp[node][1][0] = inf;
  where[node] = -1;
  dfs(node, 0);
  vector<vector<qry> > toq;
  toq.resize(v[node].size());
  for (auto it : Q)
    if (where[it.x] != -1 && where[it.y] != -1 && where[it.x] == where[it.y])
      toq[where[it.x]].push_back(it);
    else {
      ans[it.id] = inf;
      for (int j = 0; j < 2; ++j)
        for (int k = 0; k < 2; ++k)
          min_to(ans[it.id], dp[it.x][j][it.t1] + dp[it.y][k][it.t2] +
                                 (j != k) * teleport[node]);
    }
  Q.clear();
  Q.shrink_to_fit();
  used[node] = 1;
  for (int i = 0; i < v[node].size(); ++i) {
    int son = v[node][i];
    if (used[son]) continue;
    solve(son, toq[i]);
  }
}
}  // namespace centroid_decomp
int main() {
  cin.sync_with_stdio(false);
  int i, x, y, q;
  long long c1, c2;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> teleport[i];
  for (i = 1; i < n; ++i) {
    cin >> x >> y >> c1 >> c2;
    edge[x].push_back({c1, c2});
    edge[y].push_back({c1, c2});
    v[x].push_back(y);
    v[y].push_back(x);
  }
  prepare ::compute_teleport();
  vector<qry> queries;
  cin >> q;
  for (i = 1; i <= q; ++i) {
    cin >> x >> y;
    queries.push_back(
        {(x + 1) / 2, (y + 1) / 2, (x % 2 == 0), (y % 2 == 0), i});
  }
  centroid_decomp ::solve(1, queries);
  for (i = 1; i <= q; ++i) cout << ans[i] << '\n';
  return 0;
}
