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:
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};

struct weighted_union{
    vector<int> par;
    vector<int> depth;
    vector<int> heavy;
    vector<int> siz;

    weighted_union(int n) : par(n),depth(n,0),heavy(n,0),siz(n,1){
        rep(i,n) par[i]=i;
    }
    int find(int x){
        if(par[x]==x) return x;
        int parent=find(par[x]);
        heavy[x] +=heavy[par[x]];
        return par[x]=parent;
    }
    int wei(int x){
        find(x);
        return heavy[x];
    }
    void unite(int x,int y,int w){//yはxよりw重い
        w +=wei(x)-wei(y);
        x=find(x),y=find(y);
        if(x==y) return;
        siz[x] +=siz[y];
        siz[y] =siz[x];
        if(depth[x]<depth[y]){
            par[x]=y;
            heavy[x]=-w;
        }
        else{
            par[y]=x;
            heavy[y]=w;
            if(depth[x]==depth[y]) depth[x] ++;
        }
    }
    bool same(int x,int y){
        return find(x)==find(y);
    }
    int size(int x){
        return siz[find(x)];
    }
    int diff(int x,int y){//w[y]-w[x],比較不可ならinf
        if(!same(x,y)) return inf;
        return wei(y)-wei(x);
    }
};

int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int n,q;
    cin>>n>>q;
    weighted_union wuf(n);
    int x,y,z;
    int f;
    rep(i,q){
        cin>>f;
        if(f){
            cin>>x>>y;
            z=wuf.diff(x,y);
            if(z==inf) cout<<'?'<<endl;
            else cout<<z<<endl;
        }
        else{
            cin>>x>>y>>z;
            wuf.unite(x,y,z);
        }
    }
}