Problem: We have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The N points have distinct x-coordinates and distinct y-coordinates.

For a non-empty subset T of S, let f(T) be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate axes, that contains all the points in T. More formally, we define f(T) as follows:

* f(T) :=  (the number of integers i (1 \leq i \leq N) such that a \leq x_i \leq b and c \leq y_i \leq d, where a, b, c, and d are the minimum x-coordinate, the maximum x-coordinate, the minimum y-coordinate, and the maximum y-coordinate of the points in T)



Find the sum of f(T) over all non-empty subset T of S. Since it can be enormous, print the sum modulo 998244353.

Constraints

* 1 \leq N \leq 2 \times 10^5
* -10^9 \leq x_i, y_i \leq 10^9
* x_i \neq x_j (i \neq j)
* y_i \neq y_j (i \neq j)
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
x_1 y_1
:
x_N y_N


Output

Print the sum of f(T) over all non-empty subset T of S, modulo 998244353.

Examples

Input

3
-1 3
2 1
3 -2


Output

13


Input

4
1 4
2 1
3 3
4 2


Output

34


Input

10
19 -11
-3 -12
5 3
3 -15
8 -14
-9 -20
10 -9
0 2
-7 17
6 -6


Output

7222

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define ZERO (1e-10)
#define INF int(1e9+1)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define DEB printf("DEB!\n");
#define D(X) cout<<"  "<<#X": "<<X<<endl;
#define EQ(A,B) (A+ZERO>B&&A-ZERO<B)
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define IN(n) int n;scanf("%d",&n);
#define FOR(i, m, n) for (int i(m); i < n; i++)
#define F(n) FOR(i,0,n)
#define FF(n) FOR(j,0,n)
#define FT(m, n) FOR(k, m, n)
#define aa first
#define bb second
void ga(int N,int *A){F(N)scanf("%d",A+i);}
#define MOD 998244353
#define MX 222222
void rnm(int*A,int N){
    static ii B[MX];
    int L=0;
    F(N)B[i]={A[i],i};
    sort(B,B+N);
    F(N)A[B[i].bb]=L+=i&&B[i].aa^B[i-1].aa;
}
struct FW{
    int t[MX],S;
    void clr(int s){CL(t,0);S=s;}
    void inc(int i,int d){for(;i<S;i|=i+1)t[i]+=d;}
    int sum(int i){int s(0);while(~i)s+=t[i],i&=i+1,--i;return s;}
    int gt(int l,int r){return sum(r)-sum(l-1);}
}F;
int S,N,X[MX],Y[MX],H[MX],x[MX],y[MX],L[MX],R[MX],l[MX],r[MX];
ll P[MX]={1};
bool cp(int a,int b){return X[a]<X[b];}
void lgr(int*L,int*R){
    F.clr(MX-666);
    F(N)L[i]=F.sum(Y[i]),F.inc(Y[i],1),R[i]=i-L[i];
}
#define E(I) (P[I]-1)
ll go(int i){
    return ((P[N-1]+E(L[i]+l[i])*E(R[i]+r[i])-E(L[i])*E(R[i])-E(l[i])*E(r[i]))%MOD+MOD)%MOD;
}
int main(void){
    FT(1,MX)P[k]=P[k-1]*2%MOD;
    scanf("%d",&N),iota(H,H+N,0);
    F(N)scanf("%d%d",X+i,Y+i);
    rnm(X,N),rnm(Y,N);
    F(N)x[X[i]]=X[i],y[X[i]]=Y[i];
    F(N)Y[i]=y[i],X[i]=i;
    lgr(L,R),reverse(Y,Y+N),lgr(l,r),reverse(Y,Y+N),reverse(l,l+N),reverse(r,r+N);
//    F(N)printf("[%d][%d]: <<%d/%d ... %d/%d>>\n",X[i],Y[i],L[i],R[i],l[i],r[i]);
    F(N)S=(S+go(i))%MOD;
    printf("%d\n",S);
    return 0;
}