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 CPP):

Solution:
//https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_1_B
//重み付きUnion Find木
#include <bits/stdc++.h>
using namespace std;
using ll=int64_t;
#define FOR(i,a,b) for(int64_t i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//重み付きUnion Find木
template<class T>
struct wuf_tree {
    std::vector<int> parent;
    std::vector<T> diff_weight;
    int __size;
    wuf_tree(int size_, T sum_unity=T()) : parent(size_, -1), diff_weight(size_,sum_unity), __size(size_) {}
    void unite(int x, int y, T w) {
        w += weight(x);
        w -= weight(y);
        if ((x = find(x)) != (y = find(y))) {
            if (parent[y] < parent[x]) { std::swap(x, y); w=-w; }
            parent[x] += parent[y];
            parent[y] = x;
            diff_weight[y] = w;
            __size--;
        }
    }
    bool is_same(int x, int y) { return find(x) == find(y); }
    int find(int x) {
        if (parent[x]<0) return x;
        int r = find(parent[x]);
        diff_weight[x] += diff_weight[parent[x]];
        return parent[x] = r;
    }
    int size(int x) { return -parent[find(x)]; }
    int size() const { return __size; }
    T weight(int x) { find(x); return diff_weight[x]; }
    T diff(int x, int y) { return weight(y) - weight(x); }
};

int main() {
#if LOCAL&01
    std::ifstream in("./input.txt"); //input.txt
    std::cin.rdbuf(in.rdbuf());
#else
    cin.tie(0);
    ios::sync_with_stdio(false);
#endif
    ll n,q; cin>>n>>q;
    wuf_tree<ll> wuft(n);
    REP(i,q){
        ll a; cin>>a;
        if(a==0){
            ll x,y,z; cin>>x>>y>>z;
            wuft.unite(x,y,z);
        }else{
            ll x,y; cin>>x>>y;
            if(wuft.is_same(x,y)){
                cout<<wuft.diff(x,y)<<endl;
            }else{
                cout<<"?"<<endl;
            }

        }
    }
    return 0;
}