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 WeightedUnionFindTree():
    '''ランク付きUnionFind木'''
    def __init__(self, n):
        ''' 初期化 '''
        self.par = list(range(n))#自分自信を根とする
        self.rank = [0] * n # 木の高さ 最初は0
        self.w = [0] * n # 重み

    def root(self, x):
        ''' 木の根を求める '''
        if self.par[x] == x:#自分が根ノードなら
            return x

        root = self.root(self.par[x])
        self.w[x] += self.w[self.par[x]]# 累積和をとる
        self.par[x] = root
        return root
    def relate(self, x, y, weight=0):
        # x と y の root へ (x と y が既につながっていたらreturn
        root_x, root_y = self.root(x), self.root(y)
        if root_x == root_y: return;
        #木の高さ-ランクが低い方に繋げる
        if self.rank[root_x] < self.rank[root_y]:
            self.par[root_x] = root_y # 低いroot_xにroot_yを繋げ、低い方が根なのでひく
            self.w[root_x] = weight - self.w[x] + self.w[y]
        else:
            self.par[root_y] = root_x # 逆
            self.w[root_y] = -weight + self.w[x] - self.w[y]
            if self.rank[root_x] == self.rank[root_y]:
                self.rank[root_x] += 1

    def same(self, x, y):
        #xとyが同じ集合に属するか
        return self.root(x) == self.root(y)

    def diff(self, x, y):
        if self.same(x, y):
            return self.w[x] - self.w[y]
        else:
            return "?"

def querying(queries, uft):
    for query in queries:
        if query[0] == 0:#unite
            uft.relate(query[1], query[2], query[3])
        else:
            print(uft.diff(query[1], query[2]))

if __name__ == '__main__':
    # https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_1_B
    n, q = map(int, input().split())
    queries = [list(map(int, input().split())) for i in range(q)]
    uft = WeightedUnionFindTree(n)#instant UnionFindTree
    querying(queries, uft)#Querying