N, Q = gets.chomp.split(" ").map(&:to_i)
E = Hash.new{|h, k| h[k] = []}
C = Hash.new{|h, k| h[k] = []}
(N - 1).times{|n|
  a, b, c, d = gets.chomp.split(" ").map(&:to_i)
  E[a] << [b, c, d, n]
  E[b] << [a, c, d, n]
  C[c] << [n, d]
}
M = []
Q.times{
  M << gets.chomp.split(" ").map(&:to_i)
}

bef = []
P = Hash.new{|h, k| h[k] = []}
bef << 1
P[1] = [0, [], []]
until(bef.empty?) do
  nxt = []
  bef.each{|b|
    E[b].each{|a, c, d, n|
      next if P[b][1].include?(n)
      nxt << a
      P[a] = [P[b][0] + d, P[b][1].dup << n, P[b][2].dup << a]
    }
  }
  bef = nxt
end

M.each{|x, y, u, v|
  ans = P[u][0] + P[v][0]
  ol = P[u][2] & P[v][2]
  ans -= (P[ol[-1]][0] * 2) if !ol.empty?
  pth = (P[u][1] | P[v][1]) - (P[u][1] & P[v][1])
  C[x].each{|c|
    if pth.include?(c[0]) then
      ans += y - c[1]
    end
  }
  puts ans
}
