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:
#include <bits/stdc++.h>
using namespace std;
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define pb push_back
#define COUNT(V,X) upper_bound((V).begin(),(V).end(),X)-lower_bound((V).begin(),(V).end(),X)
#define debug(x) cerr<<#x<<':'<<x<<endl;
#define DEBUG(v) cerr<<#v<<':';for(auto x:v)cerr<<x<<' ';cerr<<endl;
#define INF 1000000007
#define LINF 1000000000000000007
#define EPS 1e-9
typedef long long ll;

struct WeightedUnionFind{
  vector<long long> data;
  vector<long long> dif;
  void boot(long long n){
    for(long long i = 0;i < n;i++)data.push_back(-1);
    for(long long i = 0;i < n;i++)dif.push_back(0);
    return;
  }
  long long root(long long x){
    if(data[x] < 0)return x;
    long long r = root(data[x]);
    dif[x] += dif[data[x]];
    return data[x] = root(data[x]);
  }
  long long weight(long long x){
    root(x);
    return dif[x];
  }
  bool same(long long x,long long y){
    return root(x) == root(y);
  }
  void unite(long long x,long long y,long long w){
    if(!same(x,y)){
      w += weight(x);
      w -= weight(y);
      x = root(x);
      y = root(y);
      if(data[x] < data[y]){
        data[x] += data[y];
        data[y] = x;
        dif[y] = w;
      }
      else{
        data[y] += data[x];
        data[x] = y;
        dif[x] = -w;
      }
    }
    return;
  }
  long long getsize(long long x){
    return -data[root(x)];
  }
  long long diff(long long x,long long y){
    return dif[y] - dif[x];
  }
};

signed main(){
  int n,q;
  cin >> n >> q;
  WeightedUnionFind UF;
  UF.boot(n);
  int query,x,y,z;
  FOR(i,0,q){
    cin >> query;
    if(query == 0){
      cin >> x >> y >> z;
      UF.unite(x,y,z);
    }
    else{
      cin >> x >> y;
      if(!UF.same(x,y))cout << "?" << endl;
      else cout << UF.diff(x,y) << endl;
    }
  }
}