output_description: Print the sum of f(T) over all non-empty subset T of S, modulo 998244353.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      x_1 y_1
      :
      x_N y_N
attempt: mod = 998244353
  N = int(input())
  x = [0 for i in range(N)]
  y = [0 for i in range(N)]
  for i in range(N):
      x[i], y[i] = map(int, input().split())
  # f(T)を求めて各f(T)の値に対してその値を取りうるTの状態数を求める
  # |f^-1(k)|を各1<=k<=Nで求める
  # f(T)>0
  # f^-1(1)={{1},{2},...,{N}}
  # f^-1(2)=x座標またはy座標の順番が連続していればOK　高々2(N-1)
  # f^-1(3)=xmin~xmaxとymin~ymaxの間に共通部分が存在しなければOK
  # f(T)=kのときTの要素数はk以下
  # dpとか?
  # Tがf^-1(k)の元であるとき,p not in Tにおいて
  # T cup {p}がf^-1(T)の元であるようなものはどれだけ存在するのか？
  # どこまで削られるかを測定するとか？
  # x座標かy座標が連続であるものに辺を結べばグラフになる
  # でも木にはならない
  # 連結性をうまい感じに判断すればいけるのでは？
  # サンプルの2つめは(1,4)と(1,2,4)の部分だけ余計に点が入ってしまう
  # その点は3
  # |T|=2のときはグラフにしたときの最短パスの長さになりそう
  # (1,2,4)のときは、連結なのにうまくいってない
  # 1,4の2を経由しないルートが必要なのだろうか？
  print((N * pow(2, N - 1, mod)) % mod)
  # 　　終
  # お　わ　り
  # 制作・著作
  # －－－－－
  # Ｎ　Ｈ　Ｋ
  
problem_description: Statement
  
  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.
samples: [{"input": "3\n    -1 3\n    2 1\n    3 -2", "output": "13\n    \n\nLet the first, second, and third points be P_1, P_2, and P_3, respectively. S\n= \\\\{P_1, P_2, P_3\\\\} has seven non-empty subsets, and f has the following\nvalues for each of them:\n\n  * f(\\\\{P_1\\\\}) = 1\n  * f(\\\\{P_2\\\\}) = 1\n  * f(\\\\{P_3\\\\}) = 1\n  * f(\\\\{P_1, P_2\\\\}) = 2\n  * f(\\\\{P_2, P_3\\\\}) = 2\n  * f(\\\\{P_3, P_1\\\\}) = 3\n  * f(\\\\{P_1, P_2, P_3\\\\}) = 3\n\nThe sum of these is 13.\n\n* * *"}, {"input": "4\n    1 4\n    2 1\n    3 3\n    4 2", "output": "34\n    \n\n* * *"}, {"input": "10\n    19 -11\n    -3 -12\n    5 3\n    3 -15\n    8 -14\n    -9 -20\n    10 -9\n    0 2\n    -7 17\n    6 -6", "output": "7222\n    \n\nBe sure to print the sum modulo 998244353."}]