D. Concrete Painting
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Brz and Mandy have spent long periods of time studying the number axis, familiar with all sorts of operations on it.

One day Brz obtains $$$n$$$ intervals on the number axis, the $$$i$$$-th of which is represented as $$$[l_i,r_i]$$$, denoting an interval from $$$l_i$$$ to $$$r_i$$$.

Mandy loves purple, so she decides to select some of the intervals to color them purple.

Brz wants to know that how long the number axis has been painted in total. Since Mandy has obtained a higher level of mathematical proficiency, she wants to know the sum of the painted length in all possible choices.

Specifically, Mandy want to know the result of $$$\sum_{i\subseteq S} f(i)$$$, where $$$f(i)$$$ denotes the length of the number axis that gets painted purple after Mandy colors all the intervals in set $$$i$$$, and $$$S$$$ denotes the set containing all the intervals. If a place gets painted more than once, it will be calculated only once.

It only cost Mandy 0.001s to calculate it, while Brz is still confused. So he comes to you for your help now. Since the answer may be large, please print the answer modulo $$$998244353$$$.

Input

The first line contains one integer $$$n$$$ $$$(1\leq n\leq 2\times 10^5)$$$, representing the number of interval that Brz gets.

The following $$$n$$$ lines each contains an interval. The $$$i$$$-th line contains two integers $$$l_i,r_i$$$ $$$(1\leq l_i \lt r_i\leq 10^9)$$$, denoting the $$$i$$$-th interval that Brz gets.

Output

Output one line containing one integer, representing the result modulo $$$998244353$$$.

Example
Input
2
1 3
2 4
Output
7