package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	n := getNextInt(scanner)
	q := getNextInt(scanner)

	graph := make([][]Edge, n)
	for i := 0; i < n; i++ {
		graph[i] = make([]Edge, 0)
	}

	for i := 0; i < n-1; i++ {
		a := getNextInt(scanner) - 1
		b := getNextInt(scanner) - 1
		c := getNextInt(scanner)
		d := getNextInt(scanner)
		graph[a] = append(graph[a], Edge{
			to: b,
			c:  c,
			d:  d,
		})
		graph[b] = append(graph[b], Edge{
			to: a,
			c:  c,
			d:  d,
		})
	}

	hh := make([]int, n)
	pp := make([]int, n)
	dfsh(0, -1, 0, hh, pp, graph)
	ppp := make([][]int, 64)
	ppp[0] = pp
	for i := 1; i < 64; i++ {
		ppp[i] = make([]int, n)
		for j := 0; j < n; j++ {
			ppp[i][j] = -1
			if ppp[i-1][j] == -1 {
				continue
			}
			ppp[i][j] = ppp[i-1][ppp[i-1][j]]
		}
	}

	qq := make([][]Query, n)
	cc := make([][]Query, n)
	for i := 0; i < q; i++ {
		x := getNextInt(scanner)
		y := getNextInt(scanner)
		u := getNextInt(scanner) - 1
		v := getNextInt(scanner) - 1
		qq[u] = append(qq[u], Query{
			other: v,
			x:     x,
			y:     y,
			i:     i,
		})
		qq[v] = append(qq[v], Query{
			other: u,
			x:     x,
			y:     y,
			i:     i,
		})
		j := lca(u, v, hh, ppp)
		cc[j] = append(cc[j], Query{
			other: j,
			x:     x,
			y:     y,
			i:     i,
		})
	}

	ans := make([]int, q)
	pairs := make([]Pair, n)
	dfsq(0, -1, 0, ans, pairs, ppp, cc, qq, graph)

	for i := 0; i < q; i++ {
		fmt.Fprintln(writer, ans[i])
	}
	writer.Flush()
}

func lca(u, v int, hh []int, ppp [][]int) int {
	if hh[u] > hh[v] {
		u, v = v, u
	}
	h := hh[v] - hh[u]
	for i := 0; i < 64; i++ {
		if h>>uint(i)&1 == 1 {
			v = ppp[i][v]
		}
	}
	l := -1
	r := int(1e5)
	for l+1 < r {
		m := (l + r) >> 1
		vv := v
		uu := u
		for i := 0; i < 64 && vv >= 0 && uu >= 0; i++ {
			if m>>uint(i)&1 == 1 {
				vv = ppp[i][vv]
				uu = ppp[i][uu]
			}
		}
		if vv == uu {
			r = m
			continue
		}
		l = m
	}
	for i := 0; i < 64 && u >= 0; i++ {
		if r>>uint(i)&1 == 1 {
			u = ppp[i][u]
		}
	}
	return u
}
func dfsq(i, p, sum int, ans []int, pairs []Pair, ppp [][]int, cc, qq [][]Query, graph [][]Edge) {
	for _, q := range qq[i] {
		ans[q.i] += sum - pairs[q.x].sum + q.y*pairs[q.x].cnt
	}
	for _, q := range cc[i] {
		ans[q.i] -= (sum - pairs[q.x].sum + q.y*pairs[q.x].cnt) * 2
	}
	horobiyoc := 0
	horobiyod := 0
	for _, e := range graph[i] {
		if e.to == p {
			horobiyoc = e.c
			horobiyod = e.d
			continue
		}
		pairs[e.c].cnt++
		pairs[e.c].sum += e.d
		dfsq(e.to, i, sum+e.d, ans, pairs, ppp, cc, qq, graph)
	}
	pairs[horobiyoc].cnt--
	pairs[horobiyoc].sum -= horobiyod
}

func dfsh(i, p, h int, hh, pp []int, graph [][]Edge) {
	hh[i] = h
	pp[i] = p
	for _, e := range graph[i] {
		if e.to == p {
			continue
		}
		dfsh(e.to, i, h+1, hh, pp, graph)
	}
}

type Edge struct {
	to, c, d int
}

type Query struct {
	other, x, y, i int
}

type Pair struct {
	cnt, sum int
}


Measured memory_bytes: 152320