#include <bits/stdc++.h>
using namespace std;
void solve(std::istream &in, std::ostream &out);
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  solve(std::cin, std::cout);
  return 0;
}
struct edge_t {
  int to;
  array<int64_t, 2> w;
  edge_t(int to, array<int64_t, 2> w) : to(to), w(w) {}
};
void solve(std::istream &in, std::ostream &out) {
  int n;
  in >> n;
  vector<int64_t> d(n);
  for (int64_t &i : d) {
    in >> i;
  }
  vector<vector<edge_t>> graph(n);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    in >> u >> v;
    --u, --v;
    int64_t w1, w2;
    in >> w1 >> w2;
    graph[u].emplace_back(v, array<int64_t, 2>{w1, w2});
    graph[v].emplace_back(u, array<int64_t, 2>{w1, w2});
  }
  int q;
  in >> q;
  vector<pair<int, int>> qs(q);
  vector<int64_t> ans(q, -1);
  for (auto &[u, v] : qs) {
    in >> u >> v;
    --u, --v;
  }
  {
    vector<int> Q(n);
    vector<int> p(n, -1);
    int qs = 0, qe = 0;
    Q[qe++] = 0;
    while (qs < qe) {
      int u = Q[qs++];
      for (auto &[v, w] : graph[u]) {
        if (v != p[u]) {
          Q[qe++] = v;
          p[v] = u;
        }
      }
    }
    for (int i = n - 1; i >= 0; --i) {
      int u = Q[i];
      for (auto &[v, w] : graph[u]) {
        if (v != p[v]) {
          d[u] = min(d[u], d[v] + w[0] + w[1]);
        }
      }
    }
    for (int i = 0; i < n; ++i) {
      int u = Q[i];
      for (auto &[v, w] : graph[u]) {
        if (v != p[v]) {
          d[v] = min(d[v], d[u] + w[0] + w[1]);
        }
      }
    }
  }
  vector<int> level(n, -1);
  vector<int> parent(n, -1);
  function<void(int, int, int, int)> build = [&](int v, int size, int depth,
                                                 int last) {
    function<int(int, int, int &, int)> dfs = [&](int v, int size, int &center,
                                                  int p) {
      int sum = 1;
      for (auto &[x, w] : graph[v])
        if (level[x] == -1 && x != p) sum += dfs(x, size, center, v);
      if (center == -1 && (2 * sum >= size || p == -1)) center = v;
      return sum;
    };
    int center = -1;
    dfs(v, size, center, -1);
    level[center] = depth;
    parent[center] = last;
    for (auto &[x, w] : graph[center])
      if (level[x] == -1) build(x, size / 2, depth + 1, center);
  };
  function<int(int, int)> get_center = [&](int a, int b) {
    while (level[a] > level[b]) a = parent[a];
    while (level[a] < level[b]) b = parent[b];
    while (a != b) a = parent[a], b = parent[b];
    return a;
  };
  build(0, n, 0, -1);
  vector<vector<int>> qqs(n);
  for (int i = 0; i < q; ++i) {
    int u = qs[i].first;
    int v = qs[i].second;
    qqs[get_center(u / 2, v / 2)].push_back(i);
  }
  vector<array<int64_t, 2>> dp(2 * n, array<int64_t, 2>{});
  function<void(int)> process_centroid = [&](int root) {
    static vector<bool> vis(n, false);
    fill(vis.begin(), vis.end(), false);
    function<void(int, int, array<int64_t, 2>)> collect_subtree =
        [&](int v, int p, array<int64_t, 2> e) {
          if (v != root) {
            for (int k = 0; k < 2; ++k) {
              int64_t &d1 = dp[2 * v][k];
              int64_t &d2 = dp[2 * v + 1][k];
              d1 = dp[2 * p][k] + e[0];
              d2 = dp[2 * p + 1][k] + e[1];
              d1 = min(d1, d2 + d[v]);
              d2 = min(d2, d1 + d[v]);
            }
          }
          vis[v] = true;
          for (auto &[u, w] : graph[v]) {
            if (u != p && level[u] > level[root]) {
              collect_subtree(u, v, w);
            }
          }
        };
    vis[root] = true;
    dp[2 * root][0] = dp[2 * root + 1][1] = 0;
    dp[2 * root][1] = dp[2 * root + 1][0] = d[root];
    for (auto &[v, w] : graph[root]) {
      if (level[v] > level[root]) {
        collect_subtree(v, root, w);
      }
    }
    for (int i : qqs[root]) {
      int u = qs[i].first;
      int v = qs[i].second;
      ans[i] = min(dp[u][0] + dp[v][0], dp[u][1] + dp[v][1]);
    }
  };
  for (int i = 0; i < n; ++i) {
    process_centroid(i);
  }
  for (int64_t a : ans) {
    out << a << '\n';
  }
}
