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 rep(i, n) for(int i=0; i<n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
template<class T> void puts(T x) { std::cout << x << std::endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

struct WeightedUnionFind {
    vector<int> par, rank, weight;

    WeightedUnionFind(int n) {
        par.resize(n);
        rep(i, n) par[i] = i;
        rank.resize(n);
        weight.resize(n);
    }

    int find(int x) {
        if (par[x] == x) return x;

        int y = find(par[x]);
        weight[x] += weight[par[x]];
        par[x] = y;
        return y;
    }

    void relate(int x, int y, int w) {
        // a[y] = a[x] + w
        int rx = find(x);
        int ry = find(y);
        if (rank[rx] < rank[ry]) {
            par[rx] = ry;
            weight[rx] = w - weight[x] + weight[y];
        } else {
            par[ry] = rx;
            weight[ry] = -w - weight[y] + weight[x];
            if (rank[rx] == rank[ry]) rank[rx]++;
        }
    }

    bool same(int x, int y) {
        return find(x) == find(y);
    }

    int diff(int x, int y) {
        return weight[x] - weight[y];
    }
};

int main() {
    int n, q;
    cin >> n >> q;
    WeightedUnionFind tree(n);

    int t, x, y, z;
    vector<string> ans;
    rep(i, q) {
        cin >> t;
        if (t == 0) {
            cin >> x >> y >> z;
            tree.relate(x, y, z);
        } else {
            cin >> x >> y;
            if (tree.same(x, y)) {
                ans.pb(to_string(tree.diff(x, y)));
            } else {
                ans.pb("?");
            }
        }
    }

    rep(i, ans.size()) {
        cout << ans[i] << endl;
    }
}