Problem: There is a sequence $A = a_0, a_1, ..., a_{n-1}$. You are given the following information and questions.

* relate$(x, y, z)$: $a_y$ is greater than $a_x$ by $z$
* diff$(x, y)$: report the difference between $a_x$ and $a_y$ $(a_y - a_x)$

Constraints

* $2 \leq n \leq 100,000$
* $1 \leq q \leq 200,000$
* $0 \leq x, y < n$
* $x \ne y$
* $0 \leq z \leq 10000$
* There are no inconsistency in the given information

Input


$n \; q$
$query_1$
$query_2$
:
$query_q$


In the first line, $n$ and $q$ are given. Then, $q$ information/questions are given in the following format.


0 $x \; y\; z$


or


1 $x \; y$


where '0' of the first digit denotes the relate information and '1' denotes the diff question.

Output

For each diff question, print the difference between $a_x$ and $a_y$ $(a_y - a_x)$.

Example

Input

5 6
0 0 2 5
0 1 2 3
1 0 1
1 1 3
0 1 4 8
1 0 4


Output

2
?
10

Solution (in PYTHON3):

Solution:
class UnionSet:
    def __init__(self, nmax: int) -> None:
        self.size = [1] * nmax
        self.id = [i for i in range(nmax)]
        self.weight = [0] * nmax

    def root(self, i: int) -> int:
        if (i == self.id[i]):
            return i
        else:
            tmp = self.root(self.id[i])
            self.weight[i] += self.weight[self.id[i]]
            self.id[i] = tmp
            return self.id[i]

    def get_weight(self, i: int) -> int:
        self.root(i)
        return self.weight[i]

    def connected(self, p: int, q: int) -> bool:
        return self.root(p) == self.root(q)

    def unite(self, p: int, q: int, w: int) -> None:
        w += self.get_weight(p)
        w -= self.get_weight(q)
        i, j = self.root(p), self.root(q)
        if (i == j):
            return
        if self.size[i] < self.size[j]:
            self.id[i] = j
            self.size[j] += self.size[i]
            self.weight[i] = -w
        else:
            self.id[j] = i
            self.size[i] += self.size[j]
            self.weight[j] = w

    def diff(self, p: int, q: int) -> None:
        i, j = self.root(p), self.root(q)
        if (i == j):
            print(self.get_weight(q) - self.get_weight(p))
        else:
            print("?")


if __name__ == "__main__":
    n, q = map(int, input().split())

    u = UnionSet(n)
    for _ in range(q):
        op, *v = map(lambda x: int(x), input().split())
        if (0 == op):
            x, y, w = v
            u.unite(x, y, w)
        else:
            x, y = v
            u.diff(x, y)