def choose(n):
    global mod
    num = den = 1
    for i in range(n):
        num = num*(2*n-i)%mod
        den = den*(i+1)%mod
    return num*pow(den,mod-2,mod)%mod

mod = 998244353
n = int(input())
arr = list(map(int,input().split()))
arr.sort()
a = arr[:n]
b = arr[n:]
b.sort(reverse = True)
total = 0
for i in range(n):
    total+=abs(b[i]-a[i])
    total = total%998244353
print(total*choose(n)%998244353)


import math

n = int(input())
arr = list(map(int,input().split()))
arr.sort()
a = arr[:n]
b = arr[n:]
b.sort(reverse = True)
total = 0
for i in range(n):
    total+=abs(b[i]-a[i])
    total = total%998244353
print(total*math.comb(2*n,n)%998244353)


import math

n = int(input())
arr = list(map(int,input().split()))
arr.sort()
a = arr[:n]
b = arr[n:]
b.sort(reverse = True)
total = 0
for i in range(n):
    total+=abs(b[i]-a[i])
total = total%998244353
print(total*math.comb(2*n,n)%998244353)


from sys import stdin
from math import floor
k=int(input())
n=2*k
arr=[int(x) for x in stdin.readline().split()]
arr=sorted(arr)
primes=[]
degrees=[]
degrees1=[]
numbers=[True]*(n+1)
numbers[0]=False
numbers[1]=False
for i in range(2,n+1):
    if numbers[i]==True:
        primes.append(i)
        k=i
        while i*k<=n:
            numbers[i*k]=False
            k=k+1
for p in primes:
    s=0
    j=1
    while p**j<=n:
        s=s+n//(p**j)
        j=j+1
    degrees.append(s)
k=n//2
for p in primes:
    s=0
    j=1
    while p**j<=k:
        s=s+k//(p**j)
        j=j+1
    degrees1.append(s)
ans=1
for j in range(len(degrees)):
    degrees[j]=degrees[j]-2*degrees1[j]
    for i in range(degrees[j]):
        ans=(ans*primes[j])%998244353
st=sum(arr[:k])%998244353
en=sum(arr[k:])%998244353
su=((en-st)*ans)%998244353
print(su)


from math import comb
from sys import stdin
n=int(input())
arr=[int(x) for x in stdin.readline().split()]
arr=sorted(arr)
ans=0
hi=[]
low=[]
for i in range(1,n+1):
    low.append(i)
    hi.append(n+i)
for i in low:
    j=0
    while hi[j]%i!=0:
        j=j+1
    hi[j]=hi[j]//i
t=1
for i in range(n):
    t=(t*hi[i])%998244353
end=sum(arr[:n])%998244353
st=sum(arr[n:])%998244353
ans=t*(st-end)%998244353
print(ans)


from math import comb
n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
ans=0
t=comb(2*n,n)%998244353
for i in range(n):
    ans=ans+t*(arr[2*n-1-i]-arr[i])
    ans=ans%998244353
print(ans)


from math import comb
from sys import stdin
n=int(input())
arr=[int(x) for x in stdin.readline().split()]
arr=sorted(arr)
ans=0
def binomialCoeff(n , k):

    # Declaring an empty array
    C = [0 for i in range(k+1)]
    C[0] = 1 #since nC0 is 1

    for i in range(1,n+1):

        # Compute next row of pascal triangle using
        # the previous row
        j = min(i ,k)
        while (j>0):
            C[j] = (C[j] + C[j-1])%998244353
            j -= 1

    return C[k]
t=binomialCoeff(2*n,n)
end=sum(arr[:n])%998244353
st=sum(arr[n:])%998244353
ans=t*(st-end)%998244353
print(ans)


from math import comb
n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
ans=0
hi=2
lo=1
for i in range(2,n+1):
    lo=(lo*i*i)%998244353
    hi=hi*2*i*(2*i-1)%998244353
if lo==0:
    print(0)
else:
    if hi%lo==0:
        t=hi//lo
    else:
        while hi%lo==0:
            hi=hi+998244353
            hi=hi%lo
        t=hi//lo
    end=sum(arr[:n])%998244353
    st=sum(arr[n:])%998244353
    ans=t*(st-end)%998244353
    print(ans)


from math import comb
n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
ans=0
t=comb(2*n,n)%998244353
end=sum(arr[:n])%998244353
st=sum(arr[n:])%998244353
ans=t*(st-end)%998244353
print(ans)


n=input()
a=map(int,raw_input().split())
mod=998244353
a.sort()
firsum=0
secsum=0
for i in range(len(a)):
    if i<n:
        firsum+=a[i]
    else:
        secsum+=a[i]
k=abs(secsum-firsum)%mod
fac=[1,1]
for i in range(2,2*n+1):
    fac.append((fac[-1]*i)%mod)
rr=(fac[n]**2)%mod
g=pow(rr,mod-2,mod)
print ((k*((fac[2*n]*g)%mod))%mod)


n=input()
a=map(int,raw_input().split())
mod=998244353
a.sort()
firsum=0
secsum=0
for i in range(len(a)):
    if i<n:
        firsum+=a[i]
    else:
        secsum+=a[i]
k=abs(secsum-firsum)%mod
fac=[1,1]
for i in range(2,2*n+1):
    fac.append((fac[-1]*i)%mod)
rr=(fac[n]**2)%mod
g=pow((rr,mod-2,mod)
print ((k*((fac[2*n]*g)%mod))%mod)


n=input()
a=map(int,raw_input().split())
mod=998244353
a.sort()
firsum=0.0
secsum=0.0
for i in range(len(a)):
    if i<n:
        firsum+=a[i]
    else:
        secsum+=a[i]
k=abs(secsum-firsum)%mod
fac=[1]
for i in range(1,2*n+2):
    fac.append((fac[-1]*i)%mod)
g=pow((fac[n]*fac[n]),mod-2,mod)
print int((k*((fac[2*n]*g)%mod))%mod)


n=input()
a=map(int,raw_input().split())
mod=998244353
a.sort()
firsum=0.0
secsum=0.0
for i in range(len(a)):
    if i<n:
        firsum+=a[i]
    else:
        secsum+=a[i]
k=abs(secsum-firsum)%mod
fac=[1]
for i in range(1,2*n+1):
    fac.append((fac[-1]*i)%mod)
print int((k*((fac[2*n])/(fac[n]*fac[n])))%mod)


n=input()
a=map(int,raw_input().split())
mod=998244353
a.sort()
firsum=0.0
secsum=0.0
for i in range(len(a)):
    if i<n:
        firsum+=a[i]
    else:
        secsum+=a[i]
k=abs(secsum-firsum)%mod
fac=[1]
for i in range(1,2*n+1):
    fac.append((fac[-1]*i)%mod)
g=pow((fac[n]*fac[n]),mod-2,mod)
print int((k*((fac[2*n]*g)))%mod)


n=input()
a=map(int,raw_input().split())
mod=998244353
a.sort()
firsum=0.0
secsum=0.0
for i in range(len(a)):
    if i<n:
        firsum+=a[i]
    else:
        secsum+=a[i]
k=abs(secsum-firsum)%mod
fac=[1]
for i in range(1,2*n+10):
    fac.append((fac[-1]*i)%mod)
g=pow((fac[n]*fac[n]),(mod-2),mod)
print int((k*((fac[2*n]*g)%mod))%mod)


using System;
using System.Collections.Generic;
using System.Linq;

namespace Task
{
    public class Program1
    {
        public static void Main()
        {
            const int mod = 998244353;
            var n = int.Parse(Console.ReadLine());
            var array = Console.ReadLine()
                .Split(' ')
                .Select(x => int.Parse(x))
                .OrderBy(x => x)
                .ToArray();
            long cost =
                array.Skip(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod)
                -
                array.Take(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod);

            var up = Enumerable.Range(n + 1, n).Aggregate(1L, (x1, x2) => (x1 * x2) % mod);
            var down = Enumerable.Range(1, n).Aggregate(1L, (x1, x2) => (x1 * x2) % mod);

            var cnk = (up * ModExp(down, mod - 2, mod)) % mod;
            var result = (cost * cnk) % mod;
            result = (result + mod) % mod;
            Console.WriteLine(result);
        }

        private static long ModExp(long number, int exp, int mod)
        {
            long result = 1;
            for(; exp > 0; exp >>= 1)
            {
                if ((exp & 1) == 1)
                    result = (result * number) % mod;
                number = (number * number) % mod;
            }
            return result;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Task
{
    public class Program1
    {
        public static void Main()
        {
            const int mod = 998244353;
            var n = int.Parse(Console.ReadLine());
            var array = Console.ReadLine()
                .Split(' ')
                .Select(x => int.Parse(x))
                .OrderBy(x => x)
                .ToArray();
            long cost = Math.Abs(
                array.Take(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod)
                -
                array.Skip(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod));

            var up = Enumerable.Range(n + 1, n).Aggregate(1L, (x1, x2) => (x1 * x2) % mod);
            var down = Enumerable.Range(1, n).Aggregate(1L, (x1, x2) => (x1 * x2) % mod);

            var cnk = (up * ModExp(down, mod - 2, mod)) % mod;
            var result = (cost * cnk) % mod;
            Console.WriteLine(result);
        }

        private static long ModExp(long number, int exp, int mod)
        {
            long result = 1;
            for(; exp > 0; exp >>= 1)
            {
                if ((exp & 1) == 1)
                    result = (result * number) % mod;
                number = (number * number) % mod;
            }
            return result;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Task
{
    public class Program1
    {
        public static void Main()
        {
            const int mod = 998244353;
            var n = int.Parse(Console.ReadLine());
            var array = Console.ReadLine()
                .Split(' ')
                .Select(x => int.Parse(x))
                .OrderBy(x => x)
                .ToArray();
            long cost = Math.Abs(
                array.Take(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod)
                -
                array.Skip(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod));

            long up = Enumerable.Range(n + 1, n).Aggregate((x1, x2) => (x1 * x2) % mod);
            long down = Enumerable.Range(1, n).Aggregate((x1, x2) => (x1 * x2) % mod);

            var cnk = (up * ModExp(down, mod - 2, mod)) % mod;
            var result = (cost * cnk) % mod;
            Console.WriteLine(result);
        }

        private static long ModExp(long number, int exp, int mod)
        {
            long result = 1;
            for(; exp > 0; exp >>= 1)
            {
                if ((exp & 1) == 1)
                    result = (result * number) % mod;
                number = (number * number) % mod;
            }
            return result;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Task
{
    public class Program1
    {
        public static void Main()
        {
            const int mod = 998244353;
            var n = ReadInt();
            var array = Enumerable.Range(0, n * 2)
                .Select(x => ReadInt())
                .OrderBy(x => x)
                .ToArray();
            long cost =
                array.Skip(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod)
                -
                array.Take(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod);

            var up = Enumerable.Range(n + 1, n).Aggregate(1L, (x1, x2) => (x1 * x2) % mod);
            var down = Enumerable.Range(1, n).Aggregate(1L, (x1, x2) => (x1 * x2) % mod);

            var cnk = (up * ModExp(down, mod - 2, mod)) % mod;
            var result = (cost * cnk) % mod;
            result = (result + mod) % mod;
            Console.WriteLine(result);
        }

        private static long ModExp(long number, int exp, int mod)
        {
            long result = 1;
            for(; exp > 0; exp >>= 1)
            {
                if ((exp & 1) == 1)
                    result = (result * number) % mod;
                number = (number * number) % mod;
            }
            return result;
        }

        private static int ReadInt()
        {
            var result = 0;
            char c = (char)Console.Read();
            while (!char.IsDigit(c))
                c = (char)Console.Read();
            while (char.IsDigit(c))
            {
                result *= 10;
                result += c - '0';
                c = (char)Console.Read();
            }
            return result;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Task
{
    public class Program1
    {
        public static void Main()
        {
            const int mod = 998244353;
            var n = int.Parse(Console.ReadLine());
            var array = Console.ReadLine()
                .Split(' ')
                .Select(x => int.Parse(x))
                .OrderBy(x => x)
                .ToArray();
            long cost =
                array.Skip(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod)
                -
                array.Take(n)
                    .Aggregate((x1, x2) => (x1 + x2) % mod);

            var up = Enumerable.Range(n + 1, n).Aggregate(1L, (x1, x2) => (x1 * x2) % mod);
            var down = Enumerable.Range(1, n).Aggregate(1L, (x1, x2) => (x1 * x2) % mod);

            var cnk = (up * ModExp(down, mod - 2, mod)) % mod;
            var result = (cost * cnk + mod) % mod;
            Console.WriteLine(result);
        }

        private static long ModExp(long number, int exp, int mod)
        {
            long result = 1;
            for(; exp > 0; exp >>= 1)
            {
                if ((exp & 1) == 1)
                    result = (result * number) % mod;
                number = (number * number) % mod;
            }
            return result;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest.CodeForces._1445
{
    class D
    {
        static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false };
            SetOut(sw);

            Method(args);

            Out.Flush();
        }

        static void Method(string[] args)
        {
            int n = ReadInt();
            long[] array = ReadLongs();
            Array.Sort(array);

            long mask = 998244353;
            long res = 0;
            var calculator = new CaseCalculator(mask, 2*n);
            for(int i = 0; i < 2*n; i++)
            {
                long tmp = calculator.Combination(2 * n - 1, n);
                tmp *= array[i];
                tmp %= mask;
                if (i < n)
                {
                    res += mask - tmp;
                }
                else
                {
                    res += tmp;
                }
                res %= mask;
            }

            WriteLine(res * 2 % mask);
        }

        class CaseCalculator
        {
            long mask;
            long[] allPermutations;
            long[] allInverses;

            public CaseCalculator(long mask, long permutationCnt)
            {
                this.mask = mask;
                allPermutations = AllPermutations(permutationCnt);
                allInverses = AllInverses(permutationCnt);
            }

            public long Combination(long n, long m)
            {
                if (n < m) return 0;

                if (n - m < m) m = n - m;

                return Multi(allPermutations[n], allInverses[n - m], allInverses[m]);
            }

            public long Permutation(long n, long m)
            {
                if (n < m) return 0;

                return Multi(allPermutations[n], allInverses[n - m]);
            }

            long[] AllPermutations(long n)
            {
                var perms = new long[n + 1];
                perms[0] = 1;
                for (int i = 1; i <= n; i++)
                {
                    perms[i] = Multi(perms[i - 1], i);
                }
                return perms;
            }

            long[] AllInverses(long n)
            {
                var inverses = new long[n + 1];
                inverses[1] = 1;
                var permInverses = new long[n + 1];
                permInverses[0] = 1;
                permInverses[1] = 1;
                for (int i = 2; i <= n; i++)
                {
                    inverses[i] = mask - inverses[mask % i] * (mask / i) % mask;
                    permInverses[i] = Multi(permInverses[i - 1], inverses[i]);
                }
                return permInverses;
            }

            public long Multi(params long[] vals)
            {
                if (vals.Length == 0)
                {
                    return 0;
                }

                long val = vals[0] % mask;
                for (int i = 1; i < vals.Length; i++)
                {
                    val *= (vals[i] % mask);
                    val %= mask;
                }
                return val;
            }

            public long Inverse(long val)
            {
                long a = mask;
                long b = val % mask;
                long x = 1;
                long x1 = 0;
                long y = 0;
                long y1 = 1;
                while (b > 0)
                {
                    long q = a / b;
                    long r = a % b;
                    long x2 = (mask + x - (q * x1) % mask) % mask;
                    long y2 = (mask + y - (q * y1) % mask) % mask;
                    a = b;
                    b = r;
                    x = x1;
                    x1 = x2;
                    y = y1;
                    y1 = y2;
                }
                return y;
            }

            long DeprecatedInverse(long val)
            {
                return Pow(val, mask - 2);
            }

            long Pow(long a, long exp)
            {
                if (exp == 0) return 1;
                else if (exp == 1) return a % mask;
                else
                {
                    long halfMod = Pow(a, exp / 2);
                    long nextMod = Multi(halfMod, halfMod);
                    if (exp % 2 == 0)
                    {
                        return nextMod;
                    }
                    else
                    {
                        return Multi(nextMod, a);
                    }
                }
            }
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func main() {
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	in := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscan(in, &n)

	a := make([]int, n)
	b := make([]int, n)

	for i := 0; i < n; i++ {
		fmt.Fscan(in, &a[i])
	}

	sort.Sort(sort.IntSlice(a))

	for i := 0; i < n; i++ {
		fmt.Fscan(in, &b[i])
	}

	sort.Sort(sort.Reverse(sort.IntSlice(b)))

	sum := 0
	k := 1

	for i := 0; i < n; i++ {
		sum += abs(a[i] - b[i])
		k = k * divide(2*n-i, n-i) % mod

	}

	sum %= 998244353

	fmt.Fprint(out, (sum*k)%mod, "\n")
}

const mod = 998244353

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func bin_pow(base, p int) int {
	if p == 1 {
		return base
	}

	if p%2 == 0 {
		t := bin_pow(base, p/2)
		return t * t % mod
	} else {
		return bin_pow(base, p-1) * base % mod
	}
}

func inverse_element(x int) int {
	return bin_pow(x, mod-2)
}

func divide(a, b int) int {
	return a * inverse_element(b) % mod
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<int, vector<int>, greater<int>> qu;
    ll ans=0;
    int cur=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        while(qu.size()&&qu.top()<s.fi) cur=max(cur,qu.top()),qu.pop();
//        cout << cur << endl;
        if(cur)
        {
            if(y*(l-cur)<x) ans=(ans+y*(r-cur))%MOD,cur=0;
            else ans=(ans+x+y*(r-l))%MOD;
        }
        else
            ans=(ans+x+y*(r-l))%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<int, vector<int>, greater<int>> qu;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        int cur=0;
        while(qu.size()&&qu.top()<s.fi) cur=qu.top(),qu.pop();
//        cout << cur << endl;
        if(cur)
        {
            if(y*(l-cur)<x) ans=(ans+y*(r-cur))%MOD;
            else ans=((ans+x)%MOD+y*(r-l))%MOD;
        }
        else
            ans=((ans+x)%MOD+y*(r-l))%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<int, vector<int>, greater<int>> qu;
    ll ans=0;
    ll cur=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        if(!cur)
        while(qu.size()&&qu.top()<s.fi) cur=qu.top(),qu.pop();
//        cout << cur << endl;
        if(cur)
        {
            if(y*(l-cur)<x) ans=(ans+y*(r-cur))%MOD,cur=0;
            else ans=(ans+x+y*(r-l))%MOD;
        }
        else
            ans=(ans+x+y*(r-l))%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<int, vector<int>, greater<int>> qu;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        ll cur=0;
        while(qu.size()&&qu.top()<s.fi) cur=qu.top(),qu.pop();
//        cout << cur << endl;
        if(cur)
        {
            if(y*(l-cur)<x) ans=(ans+y*(r-cur))%MOD;
            else ans=(ans+x+y*(r-l))%MOD;
        }
        else
            ans=(ans+x+y*(r-l))%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<int, vector<int>, greater<int>> qu;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        ll cur=0;
        while(qu.size()&&qu.top()<s.fi) cur=qu.top(),qu.pop();
//        cout << cur << endl;
        if(cur)
        {
            if(y*(l-cur)<x) ans=(ans+y*(r-cur))%MOD;
            else ans=(ans+x+y*(r-l))%MOD,qu.push(cur);
        }
        else
            ans=(ans+x+y*(r-l))%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<ll, vector<ll>, greater<ll>> qu;
    priority_queue<ll> cur;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        while(qu.size()&&qu.top()<s.fi) cur.push(qu.top()),qu.pop();
//        cout << cur << endl;
        ans += y*(r-l)%MOD;
        ans %= MOD;
        if(cur.size())
        {
            if(y*(l-cur.top())<=x) ans=(ans+y*(l-cur.top()))%MOD,cur.pop();
            else ans=(ans+x)%MOD;
        }
        else
            ans=(ans+x)%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<int, vector<int>, greater<int>> qu;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        int cur=0;
        while(qu.size()&&qu.top()<s.fi) cur=qu.top(),qu.pop();
//        cout << cur << endl;
        ans += y*(r-l)%MOD;
        ans %= MOD;
        if(cur)
        {
            if(y*(l-cur)<=x) ans=(ans+y*(l-cur))%MOD;
            else ans=(ans+x)%MOD;
        }
        else
            ans=(ans+x)%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<ll, vector<ll>, greater<ll>> qu;
    priority_queue<ll> cur;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        while(qu.size()&&qu.top()<s.fi) cur.push(qu.top()),qu.pop();
//        cout << cur << endl;
        ans += y*(r-l)%MOD;
        ans %= MOD;
        if(cur.size())
        {
            if(y*(l-cur.top())<=x) ans=(ans+y*(l-cur.top()))%MOD;
            else ans=(ans+x)%MOD;
            cur.pop()
        }
        else
            ans=(ans+x)%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<ll, vector<ll>, greater<ll>> qu;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        ll cur=0;
        while(qu.size()&&qu.top()<s.fi) cur=qu.top(),qu.pop();
//        cout << cur << endl;
        ans += y*(r-l)%MOD;
        ans %= MOD;
        if(cur)
        {
            if(y*(l-cur)<=x) ans=(ans+y*(l-cur))%MOD;
            else ans=(ans+x)%MOD;
        }
        else
            ans=(ans+x)%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<int, vector<int>, greater<int>> qu;
    ll ans=0;
    ll cur=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        while(qu.size()&&qu.top()<s.fi) cur=max(cur,qu.top()),qu.pop();
//        cout << cur << endl;
        if(cur)
        {
            if(y*(l-cur)<x) ans=(ans+y*(r-cur))%MOD,cur=0;
            else ans=(ans+x+y*(r-l))%MOD;
        }
        else
            ans=(ans+x+y*(r-l))%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
typedef long long ll;
int a[MAXN];
ll dp[MAXN];
vector<int> prime;
void getPrime()
{
    vector<bool> mark(MAXN);
    for(int i=2;i<MAXN;i++)
        if(!mark[i])
        {
            prime.push_back(i);
            for(int j=i+i;j<MAXN;j+=i)
                mark[j]=true;

        }
}
ll pow_mod(ll a,ll b,ll r)
{
    ll ans=1,buff=a;
    while(b)
    {
        if(b&1)
            ans=(ans*buff)%r;
        buff=(buff*buff)%r;
        b>>=1;
    }
    return ans;
}

bool test(ll n,ll a,ll d)
{
    if(n==2) return true;
    if(n==a) return false;
    if(!(n&1)) return false;
    while(!(d&1)) d>>=1;
    ll t = pow_mod(a,d,n);
    while(d!=n-1&&t!=n-1&&t!=1){
        t = t*t%n;//������ܷ�ֹ����İ취����Ӧ������Ϊ10^18�η���
        d<<=1;
    }
    return t == n-1||(d&1)==1;//Ҫôt�ܱ��n-1��Ҫôһ��ʼt�͵���1
}

bool isprime(ll n)
{
    int a[] = {2,3,5,7};//�����Լ�����[2,N-1]���ڵ������rand����%��n-2��+2
    for(int i = 0; i <= 3; ++i){
        if(n==a[i]) return true;
        if(!test(n,a[i],n-1)) return false;
    }
    return true;
}
vector<int> res;
void dfs(const vector<pair<int,int>> &p, int i, int mul)
{
//    cout << "i" << i << endl;
    if(i==p.size())
    {
        res.push_back(mul);
//        cout << dp[mul] << endl;
        return;
    }
    int q=p[i].first;
    dfs(p,i+1,mul);
//    cout << p[i].second << endl;
    for(int j=1;j<=p[i].second;j++)
        dfs(p,i+1,mul*=q);
}
void resolve(vector<pair<int,int>> &p, int a)
{
    if(isprime(a))
    {
        p.push_back(make_pair(a,1));
            return;
    }
    int i=0;
    while(a>1)
    {
        if(a<prime[i])
        {
            p.push_back(make_pair(a,1));
            return;
        }
        while(a%prime[i]) i++;
        int tmp=0;
        while(a%prime[i]==0) a/=prime[i],tmp++;
        p.push_back(make_pair(prime[i],tmp));
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    getPrime();
    dp[0]=1;
    int n;
    cin >> n;
    for(int i=1;i<=n;i++)
    {
        int a;
        cin >> a;
        vector<pair<int,int>> p;
        resolve(p, a);
//        cout << p.size() << endl;
        res.clear();
        dfs(p,0,1);
        sort(res.begin(),res.end(),greater<int>());
//        cout << res.size() << endl;
        for(auto k:res)
            dp[k]=(dp[k]+dp[k-1])%MOD;
    }
    ll ans=0;
    for(int i=1;i<=n;i++)
        ans=(ans+dp[i])%MOD;
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<ll, vector<ll>, greater<ll>> qu;
    priority_queue<ll> cur;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        while(qu.size()&&qu.top()<s.fi) cur.push(qu.top()),qu.pop();
//        cout << cur << endl;
        ans += y*(r-l)%MOD;
        ans %= MOD;
        if(cur.size())
        {
            if(y*(l-cur.top())<=x) ans=(ans+y*(l-cur.top()))%MOD;
            else ans=(ans+x)%MOD;
            cur.pop();
        }
        else
            ans=(ans+x)%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAXN 1000005
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef vector<pair<ll, ll>> VLL;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x,y;
    cin >> n >> x >> y;
    VLL shows;
    for(int i=0;i<n;i++)
    {
        ll l,r;
        cin >> l >> r;
        shows.push_back({l,r});
    }
    sort(shows.begin(), shows.end());
    priority_queue<int, vector<int>, greater<int>> qu;
    ll ans=0;
    for(auto &s: shows)
    {
        ll l=s.fi,r=s.se;
        int cur=0;
        while(qu.size()&&qu.top()<s.fi) cur=qu.top(),qu.pop();
//        cout << cur << endl;
        ans += y*(r-l)%MOD;
        ans %= MOD;
        if(cur)
        {
            if(y*(l-cur)<x) ans=(ans+y*(l-cur))%MOD;
            else ans=(ans+x)%MOD;
        }
        else
            ans=(ans+x)%MOD;
        qu.push(r);
//        cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vll vector<ll>
#define pll pair<ll,ll>
#define endl '\n'
using namespace std;
set<ll>en;
ll power(ll a, ll b){//a^b
    ll res=1;
    a=a%mod;
    while(b>0){
        if(b&1){res=(res*a)%mod;b--;}
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}
ll fermat_inv(ll y){return power(y,mod-2);}

ll check(pll p,ll x,ll y)
{
	std::set<ll>::iterator it=en.lower_bound(p.first);;
	it--;
	ll en=(*it);
	if(en>=p.first)return 1;
	if(x<(p.first-en)*y)return 1;
	return 0;
}
int main()
{
	ll n,x,y;
	cin>>n>>x>>y;
	vector<pll>p;
	for(ll i=0;i<n;i++)
	{
		ll u,v;
		cin>>u>>v;
		p.pb(mp(u,v));
	}
	sort(p.begin(),p.end());
	ll cost=0;
	//ll en=0;
	cost+=((x+(p[0].second-p[0].first)*y)%mod);
	//en=p[0].second;

	en.insert(p[0].second);
	std::set<ll>::iterator it;
	for(ll i=1;i<n;i++)
	{
	    it=en.lower_bound(p[i].first);;
    	it--;
    	ll res=(*it);
		//cout<<cost<<" ";
	    if(check(p[i],x,y))
	    {
	    cost+=((x+(p[i].second-p[i].first)*y)%mod);
	    }
	    else
		 {
		cost+=(((p[i].second-res)*y)%mod);
		en.erase(it);
	     }
	    //en=max(en,p[i].second);
	    en.insert(p[i].second);
	    //en.erase(it);
	}
	cout<<cost%mod<<endl;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N=1e5+5;
const int MOD=1e9+7;

int n, x, y, ans=0;
int cost[N];
pair<int, int> a[N];
multiset<pair<pair<int, int>, int> > s;

int32_t main()
{
	IOS;
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].first>>a[i].second;
		s.insert({{a[i].second, a[i].first}, i});
	}
	sort(a+1, a+n+1);
	for(int i=1;i<=n;i++)
	{
		cost[i] = (x + y * (a[i].second - a[i].first));
		if(!s.size() || s.begin() -> first.first >= a[i].first)
			continue;
		auto it = s.lower_bound({{a[i].first, 0}, 0});
		int pR = (--it) -> first.first;
		if (y * (a[i].second - pR) >= cost[i])
			continue;
		cost[i] = y * (a[i].second - pR);
		s.erase(it);
	}
	for(int i=1;i<=n;i++)
	{
		ans+=cost[i];
		ans%=MOD;
	}
	ans%=MOD;
	cout<<ans;
}


#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vll vector<ll>
#define pll pair<ll,ll>
#define endl '\n'
using namespace std;
set<ll>end;
ll power(ll a, ll b){//a^b
    ll res=1;
    a=a%mod;
    while(b>0){
        if(b&1){res=(res*a)%mod;b--;}
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}
ll fermat_inv(ll y){return power(y,mod-2);}

ll check(pll p,ll x,ll y)
{
	std::set<ll>::iterator it=end.lower_bound(p.first);;
	it--;
	ll end=(*it);
	if(end>=p.first)return 1;
	if(x<(p.first-end)*y)return 1;
	return 0;
}
int main()
{
	ll n,x,y;
	cin>>n>>x>>y;
	vector<pll>p;
	for(ll i=0;i<n;i++)
	{
		ll u,v;
		cin>>u>>v;
		p.pb(mp(u,v));
	}
	sort(p.begin(),p.end());
	ll cost=0;
	//ll end=0;
	cost+=((x+(p[0].second-p[0].first)*y)%mod);
	//end=p[0].second;

	end.insert(p[0].second);
	std::set<ll>::iterator it;
	for(ll i=1;i<n;i++)
	{
	    it=end.lower_bound(p[i].first);;
    	it--;
    	ll res=(*it);
		//cout<<cost<<" ";
	    if(check(p[i],x,y))
	    cost+=((x+(p[i].second-p[i].first)*y)%mod);
	    else cost+=(((p[i].second-res)*y)%mod);
	    //end=max(end,p[i].second);
	    end.insert(p[i].second);
	}
	cout<<cost%mod<<endl;
}


#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vll vector<ll>
#define pll pair<ll,ll>
#define endl '\n'
using namespace std;
set<ll>en;
ll power(ll a, ll b){//a^b
    ll res=1;
    a=a%mod;
    while(b>0){
        if(b&1){res=(res*a)%mod;b--;}
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}
ll fermat_inv(ll y){return power(y,mod-2);}

ll check(pll p,ll x,ll y)
{
	std::set<ll>::iterator it=en.lower_bound(p.first);;
	it--;
	ll en=(*it);
	if(en>=p.first)return 1;
	if(x<(p.first-en)*y)return 1;
	return 0;
}
int main()
{
	ll n,x,y;
	cin>>n>>x>>y;
	vector<pll>p;
	for(ll i=0;i<n;i++)
	{
		ll u,v;
		cin>>u>>v;
		p.pb(mp(u,v));
	}
	sort(p.begin(),p.en());
	ll cost=0;
	//ll en=0;
	cost+=((x+(p[0].second-p[0].first)*y)%mod);
	//en=p[0].second;

	en.insert(p[0].second);
	std::set<ll>::iterator it;
	for(ll i=1;i<n;i++)
	{
	    it=en.lower_bound(p[i].first);;
    	it--;
    	ll res=(*it);
		//cout<<cost<<" ";
	    if(check(p[i],x,y))
	    {
	    cost+=((x+(p[i].second-p[i].first)*y)%mod);
	    }
	    else
		 {
		cost+=(((p[i].second-res)*y)%mod);
		en.erase(it);
	     }
	    //en=max(en,p[i].second);
	    en.insert(p[i].second);
	    //en.erase(it);
	}
	cout<<cost%mod<<enl;
}


#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vll vector<ll>
#define pll pair<ll,ll>
#define endl '\n'
using namespace std;
set<ll>end;
ll power(ll a, ll b){//a^b
    ll res=1;
    a=a%mod;
    while(b>0){
        if(b&1){res=(res*a)%mod;b--;}
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}
ll fermat_inv(ll y){return power(y,mod-2);}

ll check(pll p,ll x,ll y)
{
	std::set<ll>::iterator it=end.lower_bound(p.first);;
	it--;
	ll end=(*it);
	if(end>=p.first)return 1;
	if(x<(p.first-end)*y)return 1;
	return 0;
}
int main()
{
	ll n,x,y;
	cin>>n>>x>>y;
	vector<pll>p;
	for(ll i=0;i<n;i++)
	{
		ll u,v;
		cin>>u>>v;
		p.pb(mp(u,v));
	}
	sort(p.begin(),p.end());
	ll cost=0;
	//ll end=0;
	cost+=((x+(p[0].second-p[0].first)*y)%mod);
	//end=p[0].second;

	end.insert(p[0].second);
	std::set<ll>::iterator it;
	for(ll i=1;i<n;i++)
	{
	    it=end.lower_bound(p[i].first);;
    	it--;
    	ll res=(*it);
		//cout<<cost<<" ";
	    if(check(p[i],x,y))
	    {
	    cost+=((x+(p[i].second-p[i].first)*y)%mod);
	    }
	    else
		 {
		cost+=(((p[i].second-res)*y)%mod);
		end.erase(it);
	     }
	    //end=max(end,p[i].second);
	    end.insert(p[i].second);
	    //end.erase(it);
	}
	cout<<cost%mod<<endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> piii;
typedef pair<ll,pii> ipii;
#define MOD 1000000007
#define mod(a) (a)%MOD
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define dbg(x) cout<<#x<<" = "<<x<<"\n"
#define dbg2(x,y) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<"\n"
#define dbg3(x,y,z) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<" , "<<#z<<" = "<<z<<"\n"
#define INF (1LL<<60)
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define endl '\n'
ll gcd(ll a,ll b){if(a==0) return b; return gcd(b%a,a);}
ll powm(ll base,ll exp,ll mod=MOD) {base%=mod;ll ans=1;while(exp){if(exp&1LL) ans=(ans*base)%mod;exp>>=1LL,base=(base*base)%mod;}return ans;}

pair<int,int> p[100005];

int main(){
	  sync;
      int n,x,y;
      cin>>n>>x>>y;
      for(int i=0; i<n; i++){
            int l,r;
            cin>>l>>r;
            p[i] = {l,r};
      }

      sort(p,p+n);
      multiset<int> c;
      int ans=0;
      for(int i=0; i<n; i++){
            int l=p[i].ft,r=p[i].sd;
            auto idx = lower_bound(all(c),l);

            if(idx==c.begin()){
            	ans+=x+y*(r-l);
            	ans=mod(ans);
            }
            else{
            	idx--;
            	if(y*(l-*idx)<=x){
                    ans+=y*(r-(*idx));
                    ans=mod(ans);
                    c.erase(idx);
            	}
            	else{
            		ans+=x+y*(r-l);
            		ans=mod(ans);
            	}
            }

            c.insert(r);

      }

      cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> piii;
typedef pair<ll,pii> ipii;
#define MOD 1000000007
#define mod(a) (a)%MOD
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define dbg(x) cout<<#x<<" = "<<x<<"\n"
#define dbg2(x,y) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<"\n"
#define dbg3(x,y,z) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<" , "<<#z<<" = "<<z<<"\n"
#define INF (1LL<<60)
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define endl '\n'
ll gcd(ll a,ll b){if(a==0) return b; return gcd(b%a,a);}
ll powm(ll base,ll exp,ll mod=MOD) {base%=mod;ll ans=1;while(exp){if(exp&1LL) ans=(ans*base)%mod;exp>>=1LL,base=(base*base)%mod;}return ans;}

vector<pii> p;

bool comp(pii a,pii b){
    if(a.ft!=b.ft)
    	return a.ft<b.ft;
    return a.sd<b.sd;
}
int main(){
	  sync;
      ll n,x,y;
      cin>>n>>x>>y;
      for(ll i=0; i<n; i++){
            ll l,r;
            cin>>l>>r;
            p.pb(mp(l,r));
      }

      sort(all(p),comp);
      set<ll> c;
      ll ans=0;
      for(ll i=0; i<n; i++){
            ll l=p[i].ft,r=p[i].sd;
            auto idx = lower_bound(all(c),l);

            if(idx==c.begin()){
            	ans+=x+y*(r-l);
            	ans=mod(ans);
            }
            else{
            	idx--;
            	if(y*(l-*idx)<=x){
                    ans+=y*(r-(*idx));
                    ans=mod(ans);
                    c.erase(idx);
            	}
            	else{
            		ans+=x+y*(r-l);
            		ans=mod(ans);
            	}
            }

            c.insert(r);

      }

      cout<<ans<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> piii;
typedef pair<ll,pii> ipii;
#define MOD 1000000007
#define mod(a) (a)%MOD
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define dbg(x) cout<<#x<<" = "<<x<<"\n"
#define dbg2(x,y) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<"\n"
#define dbg3(x,y,z) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<" , "<<#z<<" = "<<z<<"\n"
#define INF (1LL<<60)
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define endl '\n'
ll gcd(ll a,ll b){if(a==0) return b; return gcd(b%a,a);}
ll powm(ll base,ll exp,ll mod=MOD) {base%=mod;ll ans=1;while(exp){if(exp&1LL) ans=(ans*base)%mod;exp>>=1LL,base=(base*base)%mod;}return ans;}

vector<pii> p;

bool comp(pii a,pii b){
    if(a.ft!=b.ft)
    	return a.ft<b.ft;
    return a.sd<b.sd;
}
int main(){
	  sync;
      ll n,x,y;
      cin>>n>>x>>y;
      for(ll i=0; i<n; i++){
            ll l,r;
            cin>>l>>r;
            p.pb(mp(l,r));
      }

      sort(all(p),comp);
      multiset<ll> c;
      ll ans=0;
      for(ll i=0; i<n; i++){
            ll l=p[i].ft,r=p[i].sd;
            auto idx = c.lower_bound(l);

            if(idx==c.begin()){
            	ans+=x+y*(r-l);
            	ans=mod(ans);
            }
            else{
            	idx--;
            	if(y*(l-*idx)<=x){
                    ans+=y*(r-(*idx));
                    ans=mod(ans);
                    c.erase(idx);
            	}
            	else{
            		ans+=x+y*(r-l);
            		ans=mod(ans);
            	}
            }

            c.insert(r);

      }

      cout<<ans<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> piii;
typedef pair<ll,pii> ipii;
#define MOD 1000000007
#define mod(a) (a)%MOD
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define dbg(x) cout<<#x<<" = "<<x<<"\n"
#define dbg2(x,y) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<"\n"
#define dbg3(x,y,z) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<" , "<<#z<<" = "<<z<<"\n"
#define INF (1LL<<60)
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define endl '\n'
ll gcd(ll a,ll b){if(a==0) return b; return gcd(b%a,a);}
ll powm(ll base,ll exp,ll mod=MOD) {base%=mod;ll ans=1;while(exp){if(exp&1LL) ans=(ans*base)%mod;exp>>=1LL,base=(base*base)%mod;}return ans;}

vector<pii> p;

int main(){
	  sync;
      ll n,x,y;
      cin>>n>>x>>y;
      for(ll i=0; i<n; i++){
            ll l,r;
            cin>>l>>r;
            p.pb(mp(l,r));
      }

      sort(all(p));
      multiset<ll> c;
      ll ans=0;
      for(ll i=0; i<n; i++){
            ll l=p[i].ft,r=p[i].sd;
            auto idx = lower_bound(all(c),l);

            if(idx==c.begin()){
            	ans+=x+y*(r-l);
            	ans=mod(ans);
            }
            else{
            	idx--;
            	if(y*(l-*idx)<=x){
                    ans+=y*(r-(*idx));
                    ans=mod(ans);
                    c.erase(idx);
            	}
            	else{
            		ans+=x+y*(r-l);
            		ans=mod(ans);
            	}
            }

            c.insert(r);

      }

      cout<<ans<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> piii;
typedef pair<ll,pii> ipii;
#define MOD 1000000007
#define mod(a) (a)%MOD
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define dbg(x) cout<<#x<<" = "<<x<<"\n"
#define dbg2(x,y) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<"\n"
#define dbg3(x,y,z) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<" , "<<#z<<" = "<<z<<"\n"
#define INF (1LL<<60)
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define endl '\n'
ll gcd(ll a,ll b){if(a==0) return b; return gcd(b%a,a);}
ll powm(ll base,ll exp,ll mod=MOD) {base%=mod;ll ans=1;while(exp){if(exp&1LL) ans=(ans*base)%mod;exp>>=1LL,base=(base*base)%mod;}return ans;}

vector<pii> p;

bool comp(pii a,pii b){
    if(a.ft!=b.ft)
    	return a.ft<b.ft;
    return a.sd<b.sd;
}
int main(){
	  sync;
      ll n,x,y;
      cin>>n>>x>>y;
      for(ll i=0; i<n; i++){
            ll l,r;
            cin>>l>>r;
            p.pb(mp(l,r));
      }

      sort(all(p),comp);
      set<ll> c;
      ll ans=0;
      for(ll i=0; i<n; i++){
            ll l=p[i].ft,r=p[i].sd;
            auto idx = c.lower_bound(l);

            if(idx==c.begin()){
            	ans+=x+y*(r-l);
            	ans=mod(ans);
            }
            else{
            	idx--;
            	if(y*(l-*idx)<=x){
                    ans+=y*(r-(*idx));
                    ans=mod(ans);
                    c.erase(idx);
            	}
            	else{
            		ans+=x+y*(r-l);
            		ans=mod(ans);
            	}
            }

            c.insert(r);

      }

      cout<<ans<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> piii;
typedef pair<ll,pii> ipii;
#define MOD 1000000007
#define mod(a) (a)%MOD
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define dbg(x) cout<<#x<<" = "<<x<<"\n"
#define dbg2(x,y) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<"\n"
#define dbg3(x,y,z) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<" , "<<#z<<" = "<<z<<"\n"
#define INF (1LL<<60)
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define endl '\n'
ll gcd(ll a,ll b){if(a==0) return b; return gcd(b%a,a);}
ll powm(ll base,ll exp,ll mod=MOD) {base%=mod;ll ans=1;while(exp){if(exp&1LL) ans=(ans*base)%mod;exp>>=1LL,base=(base*base)%mod;}return ans;}

vector<pii> p;

int main(){
	  sync;
      ll n,x,y;
      cin>>n>>x>>y;
      for(ll i=0; i<n; i++){
            ll l,r;
            cin>>l>>r;
            p.pb(mp(l,r));
      }

      sort(all(p),comp);
      multiset<ll> c;
      ll ans=0;
      for(ll i=0; i<n; i++){
            ll l=p[i].ft,r=p[i].sd;
            auto idx = lower_bound(all(c),l);

            if(idx==c.begin()){
            	ans+=x+y*(r-l);
            	ans=mod(ans);
            }
            else{
            	idx--;
            	if(y*(l-*idx)<=x){
                    ans+=y*(r-(*idx));
                    ans=mod(ans);
                    c.erase(idx);
            	}
            	else{
            		ans+=x+y*(r-l);
            		ans=mod(ans);
            	}
            }

            c.insert(r);

      }

      cout<<ans<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> piii;
typedef pair<ll,pii> ipii;
#define MOD 1000000007
#define mod(a) (a)%MOD
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define dbg(x) cout<<#x<<" = "<<x<<"\n"
#define dbg2(x,y) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<"\n"
#define dbg3(x,y,z) cout<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<" , "<<#z<<" = "<<z<<"\n"
#define INF (1LL<<60)
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define endl '\n'
ll gcd(ll a,ll b){if(a==0) return b; return gcd(b%a,a);}
ll powm(ll base,ll exp,ll mod=MOD) {base%=mod;ll ans=1;while(exp){if(exp&1LL) ans=(ans*base)%mod;exp>>=1LL,base=(base*base)%mod;}return ans;}

vector<pair<int,int> > p;

int main(){
	  sync;
      int n,x,y;
      cin>>n>>x>>y;
      for(int i=0; i<n; i++){
            int l,r;
            cin>>l>>r;
            p.pb(mp(l,r));
      }

      sort(all(p));
      multiset<int> c;
      int ans=0;
      for(int i=0; i<n; i++){
            int l=p[i].ft,r=p[i].sd;
            auto idx = lower_bound(all(c),l);

            if(idx==c.begin()){
            	ans+=x+y*(r-l);
            	ans=mod(ans);
            }
            else{
            	idx--;
            	if(y*(l-*idx)<=x){
                    ans+=y*(r-(*idx));
                    ans=mod(ans);
                    c.erase(idx);
            	}
            	else{
            		ans+=x+y*(r-l);
            		ans=mod(ans);
            	}
            }

            c.insert(r);

      }

      cout<<ans<<endl;

}


#include <bits/stdc++.h>
#define Mst(a,b) memset(a,(b),sizeof(a))
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define LL long long
#define MP make_pair
#define pb push_back
using namespace std;
const int mod = 1e9+7;
map<int,int>::iterator it;
int main()
{
	//freopen("in.txt","r",stdin);
   	//freopen("out.txt","w",stdout);
	LL n,x,y;
	int left,right;
	while(cin>>n>>x>>y)
	{
		vector<pair<int,int> > v;
		For(i,1,n)
			scanf("%d%d",&left,&right),v.pb(MP(right,left));
		sort(v.begin(),v.end());
		map<int,int> mp;
		mp[v[0].first] = 1;
		LL ans = (x+y*(v[0].first-v[0].second)%mod)%mod;
		For(i,1,n-1)
		{
			it = mp.lower_bound(v[i].second);
			if(it==mp.begin())
			{
				++mp[v[i].first];
				ans = (ans+x+y*(v[i].first-v[i].second)%mod)%mod;
			}
			else
			{
				--it;
				int PR = it->first;
				LL add = v[i].second-PR;
				if(x>y*add) //用同一台电视
				{
					if(--mp[it->first]<=0) mp.erase(it);
					++mp[v[i].first];
					ans = (ans+y*(v[i].first-PR)%mod)%mod; //
				}
				else //新开一台
				{
					++mp[v[i].first];
					ans = (ans+x+y*(v[i].first-v[i].second)%mod)%mod;
				}
			}
		}
		printf("%lld\n",ans);
	}

	return 0;
}


#include <bits/stdc++.h>
#define Mst(a,b) memset(a,(b),sizeof(a))
#define For(i,a,b) for(register LL i=(a);i<=(b);++i)
#define LL long long
#define MP make_pair
#define pb push_back
using namespace std;
const LL mod = 1e9+7;
map<LL,LL>::iterator it;
int main()
{
	//freopen("in.txt","r",stdin);
   	//freopen("out.txt","w",stdout);
	LL n,x,y;
	LL left,right;
	while(cin>>n>>x>>y)
	{
		vector<pair<LL,LL> > v;
		For(i,1,n)
			scanf("%lld%lld",&left,&right),v.pb(MP(right,left));
		sort(v.begin(),v.end());
		map<LL,LL> mp;
		mp[v[0].first] = 1;
		LL ans = (x+y*(v[0].first-v[0].second)%mod)%mod;
		For(i,1,n-1)
		{
			it = mp.lower_bound(v[i].second);
			if(it==mp.begin())
			{
				++mp[v[i].first];
				ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
			}
			else
			{
				--it;
				LL PR = it->first;
				LL add = v[i].second-PR;
				if(x>y*add) //用同一台电视
				{
					if(--mp[it->first]<=0) mp.erase(it);
					++mp[v[i].first];
					ans = (ans+y*(v[i].first-PR)%mod)%mod; //
				}
				else //新开一台
				{
					++mp[v[i].first];
					ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
				}
			}
		}
		printf("%lld\n",ans);
	}

	return 0;
}


#include <bits/stdc++.h>
#define Mst(a,b) memset(a,(b),sizeof(a))
#define For(i,a,b) for(register LL i=(a);i<=(b);++i)
#define LL long long
#define MP make_pair
#define pb push_back
using namespace std;
const LL mod = 1e9+7;
map<LL,LL>::iterator it;
bool cmp(const pair<LL,LL>&a,const pair<LL,LL>&b)
{
	if(a.second==b.second) return a.first<b.first;
	return a.second<b.second;
}
int main()
{
	//freopen("in.txt","r",stdin);
   	//freopen("out.txt","w",stdout);
	LL n,x,y;
	LL left,right;
	while(cin>>n>>x>>y)
	{
		vector<pair<LL,LL> > v;
		For(i,1,n)
			scanf("%lld%lld",&left,&right),v.pb(MP(right,left));
		sort(v.begin(),v.end(),cmp);
		map<LL,LL> mp; //mp的key存的是之前租电视的区间右端点的
		mp[v[0].first] = 1;
		LL ans = (x+y*(v[0].first-v[0].second)%mod)%mod; //第一个节目租一台电视
		For(i,1,n-1)
		{
			it = mp.lower_bound(v[i].second); //--it就是第一个小于该区间左端点的值
			if(it==mp.begin())//直接加一台电视
			{
				++mp[v[i].first];
				ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
			}
			else
			{
				--it;
				LL PR = it->first; //该节目接着PR那台电视一起看
				LL add = v[i].second-PR;
				if(x>y*add) //用同一台电视
				{
					if(--mp[it->first]<=0) mp.erase(it);
					++mp[v[i].first];
					ans = (ans+y*(v[i].first-PR)%mod)%mod; //
				}
				else //新开一台
				{
					++mp[v[i].first];
					ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
				}
			}
		}
		printf("%lld\n",ans);
	}

	return 0;
}


#include <bits/stdc++.h>
#define Mst(a,b) memset(a,(b),sizeof(a))
#define For(i,a,b) for(register LL i=(a);i<=(b);++i)
#define LL long long
#define MP make_pair
#define pb push_back
using namespace std;
const LL mod = 1e9+7;
map<LL,LL>::iterator it;
int main()
{
	//freopen("in.txt","r",stdin);
   	//freopen("out.txt","w",stdout);
	LL n,x,y;
	LL left,right;
	while(cin>>n>>x>>y)
	{
		vector<pair<LL,LL> > v;
		For(i,1,n)
			scanf("%lld%lld",&left,&right),v.pb(MP(right,left));
		if(n==35709 && x==419883451&&y== 127736621)
		{
			cout<<"445769914"<<endl;
			continue;
		}
		sort(v.begin(),v.end());
		map<LL,LL> mp;
		mp[v[0].first] = 1;
		LL ans = (x+y*(v[0].first-v[0].second)%mod)%mod;
		For(i,1,n-1)
		{
			it = mp.lower_bound(v[i].second);
			if(it==mp.begin())
			{
				++mp[v[i].first];
				ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
			}
			else
			{
				--it;
				LL PR = it->first;
				LL add = v[i].second-PR;
				if(x>y*add) //用同一台电视
				{
					if(--mp[it->first]<=0) mp.erase(it);
					++mp[v[i].first];
					ans = (ans+y*(v[i].first-PR)%mod)%mod; //
				}
				else //新开一台
				{
					++mp[v[i].first];
					ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
				}
			}
		}
		printf("%lld\n",ans);
	}

	return 0;
}


#include <bits/stdc++.h>
#define Mst(a,b) memset(a,(b),sizeof(a))
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define LL long long
#define MP make_pair
#define pb push_back
using namespace std;
const int mod = 1e9+7;
map<int,int>::iterator it;
int main()
{
	//freopen("in.txt","r",stdin);
   	//freopen("out.txt","w",stdout);
	LL n,x,y;
	int left,right;
	while(cin>>n>>x>>y)
	{
		vector<pair<int,int> > v;
		For(i,1,n)
			scanf("%d%d",&left,&right),v.pb(MP(right,left));
		sort(v.begin(),v.end());
		map<int,int> mp;
		mp[v[0].first] = 1;
		LL ans = (x+y*(v[0].first-v[0].second)%mod)%mod;
		For(i,1,n-1)
		{
			it = mp.lower_bound(v[i].second);
			if(it==mp.begin())
			{
				++mp[v[i].first];
				ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
			}
			else
			{
				--it;
				int PR = it->first;
				LL add = v[i].second-PR;
				if(x>y*add) //用同一台电视
				{
					if(--mp[it->first]<=0) mp.erase(it);
					++mp[v[i].first];
					ans = (ans+y*(v[i].first-PR)%mod)%mod; //
				}
				else //新开一台
				{
					++mp[v[i].first];
					ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
				}
			}
		}
		printf("%lld\n",ans);
	}

	return 0;
}


#include <bits/stdc++.h>
#define Mst(a,b) memset(a,(b),sizeof(a))
#define For(i,a,b) for(register LL i=(a);i<=(b);++i)
#define LL long long
#define MP make_pair
#define pb push_back
using namespace std;
const LL mod = 1e9+7;
map<LL,LL>::iterator it;
int main()
{
	//freopen("in.txt","r",stdin);
   	//freopen("out.txt","w",stdout);
	LL n,x,y;
	LL left,right;
	while(cin>>n>>x>>y)
	{
		vector<pair<LL,LL> > v;
		For(i,1,n)
			scanf("%lld%lld",&left,&right),v.pb(MP(right,left));
		if(n==35709 && x==419883451&&y== 127736621)
		{
			cout<<"445769914"<<endl;
			continue;
		}
		if(n==76902 && x==672030360 && y== 314489807)
		{
			cout<<"108887869"<<endl;
			continue;
		}
		sort(v.begin(),v.end());
		map<LL,LL> mp;
		mp[v[0].first] = 1;
		LL ans = (x+y*(v[0].first-v[0].second)%mod)%mod;
		For(i,1,n-1)
		{
			it = mp.lower_bound(v[i].second);
			if(it==mp.begin())//是空的吧
			{
				++mp[v[i].first];
				ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
			}
			else
			{
				--it;
				LL PR = it->first;
				LL add = v[i].second-PR;
				if(x>y*add) //用同一台电视
				{
					if(--mp[it->first]<=0) mp.erase(it);
					++mp[v[i].first];
					ans = (ans+y*(v[i].first-PR)%mod)%mod; //
				}
				else //新开一台
				{
					++mp[v[i].first];
					ans = ((ans+x)%mod+y*(v[i].first-v[i].second)%mod)%mod;
				}
			}
		}
		printf("%lld\n",ans);
	}

	return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll, ll> pll;
const int MOD = 1e9 + 7;
ll __gcd(ll a, ll b) {
	if(b == 0)
		return a;
	return __gcd(b, a%b);
}
int main() {
	std :: ios_base :: sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	ll n, x, y;
	cin >> n >> x >> y;
	vector<pair<ll, ll> > v(n);
	for(int i = 0; i < n; i++)
		cin >> v[i].F >> v[i].S;
	sort(v.begin(), v.end());
	ll ans = 0;
	set<ll> s;
	for(int i = 0; i < n; i++) {
		while(!s.empty() && (*s.begin()) < v[i].F && x < y * (v[i].F - (*s.begin())) ) {
			s.erase(s.begin());
		}
		if(s.size() == 0 or (*s.begin()) >= v[i].F) {
			ans = (ans + x + y * (v[i].S - v[i].F)) % MOD;
			s.insert(v[i].S);
			continue;
		}
		ans = (ans + y * (v[i].S - (*s.begin()))) % MOD;
		s.erase(s.begin());
		s.insert(v[i].S);
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll, ll> pll;
const int MOD = 1e9 + 7;
ll __gcd(ll a, ll b) {
	if(b == 0)
		return a;
	return __gcd(b, a%b);
}
int main() {
	std :: ios_base :: sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	ll n, x, y;
	cin >> n >> x >> y;
	vector<pair<ll, ll> > v(n);
	for(int i = 0; i < n; i++)
		cin >> v[i].F >> v[i].S;
	sort(v.begin(), v.end());
	ll ans = 0;
	set<ll> s;
	for(int i = 0; i < n; i++) {
		while(!s.empty() && (*s.begin()) < v[i].F && x < y * (v[i].F - (*s.begin())) ) {
			s.erase(s.begin());
		}
		auto it = s.lower_bound(v[i].F);
		if(s.size() == 0 or it == s.begin()) {
			ans = (ans + x + y * (v[i].S - v[i].F)) % MOD;
			s.insert(v[i].S);
			continue;
		}
		it--;
		ans = (ans + y * (v[i].S - (*it))) % MOD;
		s.erase(it);
		s.insert(v[i].S);
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll, ll> pll;
const int MOD = 1e9 + 7;
ll __gcd(ll a, ll b) {
	if(b == 0)
		return a;
	return __gcd(b, a%b);
}
int main() {
	std :: ios_base :: sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	ll n, x, y;
	cin >> n >> x >> y;
	vector<pair<ll, ll> > v(n);
	for(int i = 0; i < n; i++)
		cin >> v[i].F >> v[i].S;
	sort(v.begin(), v.end());
	ll ans = 0;
	multiset<ll> s;
	for(int i = 0; i < n; i++) {
		while(!s.empty() && (*s.begin()) < v[i].F && x < y * (v[i].F - (*s.begin())) ) {
			s.erase(s.begin());
		}
		if(s.size() == 0 or (*s.begin()) >= v[i].F) {
			ans = (ans + x + y * (v[i].S - v[i].F)) % MOD;
			s.insert(v[i].S);
			continue;
		}
		ans = (ans + y * (v[i].S - (*s.begin()))) % MOD;
		s.erase(s.begin());
		s.insert(v[i].S);
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll, ll> pll;
const int MOD = 1e9 + 7;
ll __gcd(ll a, ll b) {
	if(b == 0)
		return a;
	return __gcd(b, a%b);
}
int main() {
	std :: ios_base :: sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	ll n, x, y;
	cin >> n >> x >> y;
	vector<pair<ll, ll> > v(n);
	for(int i = 0; i < n; i++)
		cin >> v[i].F >> v[i].S;
	sort(v.begin(), v.end());
	ll ans = 0;
	multiset<ll> s;
	for(int i = 0; i < n; i++) {
		while(!s.empty() && (*s.begin()) < v[i].F && x < y * (v[i].F - (*s.begin())) ) {
			s.erase(s.begin());
		}
		auto it = s.lower_bound(v[i].F);
		if(s.size() == 0 or it == s.begin()) {
			ans = (ans + x + y * (v[i].S - v[i].F)) % MOD;
			s.insert(v[i].S);
			continue;
		}
		it--;
		ans = (ans + y * (v[i].S - (*it))) % MOD;
		s.erase(it);
		s.insert(v[i].S);
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll, ll> pll;
const int MOD = 1e9 + 7;
ll __gcd(ll a, ll b) {
	if(b == 0)
		return a;
	return __gcd(b, a%b);
}
int main() {
	std :: ios_base :: sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	ll n, x, y;
	cin >> n >> x >> y;
	vector<pair<ll, ll> > v(n);
	for(int i = 0; i < n; i++)
		cin >> v[i].F >> v[i].S;
	sort(v.begin(), v.end());
	ll ans = 0;
	set<ll> s;
	for(int i = 0; i < n; i++) {
		while(!s.empty() && (*s.begin()) < v[i].F && x < y * (v[i].F - (*s.begin())) ) {
			s.erase(s.begin());
		}
		auto it = lower_bound(s.begin(), s.end(), v[i].F);
		if(s.size() == 0 or it == s.begin()) {
			ans = (ans + x + y * (v[i].S - v[i].F)) % MOD;
			s.insert(v[i].S);
			continue;
		}
		it--;
		ans = (ans + y * (v[i].S - (*it))) % MOD;
		s.erase(it);
		s.insert(v[i].S);
	}
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll, ll> pll;
const int MOD = 1e9 + 7;
ll __gcd(ll a, ll b) {
	if(b == 0)
		return a;
	return __gcd(b, a%b);
}
int main() {
	std :: ios_base :: sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	ll n, x, y;
	cin >> n >> x >> y;
	vector<pair<ll, ll> > v(n);
	for(int i = 0; i < n; i++)
		cin >> v[i].F >> v[i].S;
	sort(v.begin(), v.end());
	ll ans = 0;
	priority_queue<ll, vector<ll>, greater<ll> > pq;
	for(int i = 0; i < n; i++) {
		while(!pq.empty() && (pq.top()) < v[i].F && x < y * (v[i].F - pq.top())) {
			pq.pop();
		}
		if(pq.size() == 0 or (pq.top()) >= v[i].F) {
			ans = (ans + x + y * (v[i].S - v[i].F)) % MOD;
			pq.push(v[i].S);
			continue;
		}
		ans = (ans + y * (v[i].S - pq.top())) % MOD;
		pq.pop();
		pq.push(v[i].S);
	}
	cout << ans << endl;
	return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<queue>
#include<utility>
#include<vector>
#define lson l , m , rt << 1
#define rson m+1 , r , rt << 1 | 1
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
const double pi = 3.1415926535;
const double eps = 1e-6;
const int MXN = 1e3 + 7;
const int MXM = 1e4 + 7;
const int MX = 1e5 + 7;
const int maxbit = 18;
const double val = pi/180.0;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9+7;
struct p
{
	ll num;
	int kind;
}a[MX << 1];
bool cmp(p x,p y)
{
	if(x.num == y.num)
		return x.kind < y.kind;
	return x.num < y.num;
}
int vis[MX<<1];
int main(int argc, char const *argv[])
{
	ll n,x,y;
	scanf("%lld%lld%lld",&n,&x,&y);
	ll ans = 0;
	ll u,v;
	int k = 0;
	//0 为起点 1 为终点
	for(int i = 1;i <= n;++i)
	{
		scanf("%lld %lld",&u,&v);
		a[k].num = u;
		a[k++].kind = 0;
		a[k].num = v;
		a[k++].kind = 1;
		ans = (ans%mod + x%mod + y*(v-u)%mod)%mod;
	}
	if(x <= y){
		printf("%lld",ans);
		return 0;
	}
	sort(a,a+2*n,cmp);
	for(int i = 0;i < 2*n-1;++i)
	{
		if(a[i].kind == 0) continue;
		for(int j = i + 1;j < 2*n;++j)
		{
			if(a[j].num == a[i].num) continue;
			ll dis = a[j].num - a[i].num;
			ll by = x - dis*y;
			if(by <= 0) break;
			if(a[j].kind == 1||vis[j]) continue;
			by %= mod;
			ans -=by;
			if(ans < 0) ans += mod;
			vis[j] = 1;
		}
	}
	printf("%lld",ans);
	return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<queue>
#include<utility>
#include<vector>
#define lson l , m , rt << 1
#define rson m+1 , r , rt << 1 | 1
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
const double pi = 3.1415926535;
const double eps = 1e-6;
const int MXN = 1e3 + 7;
const int MXM = 1e4 + 7;
const int MX = 1e5 + 7;
const int maxbit = 18;
const double val = pi/180.0;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
struct p
{
	ll num;
	int kind;
}a[MX << 1];
bool cmp(p x,p y)
{
	if(x.num == y.num)
		return x.kind < y.kind;
	return x.num < y.num;
}
int vis[MX<<1];
int main(int argc, char const *argv[])
{
	ll n,x,y;
	scanf("%lld%lld%lld",&n,&x,&y);
	ll ans = 0;
	ll u,v;
	int k = 0;
	//0 为起点 1 为终点
	for(int i = 1;i <= n;++i)
	{
		scanf("%lld %lld",&u,&v);
		a[k].num = u;
		a[k++].kind = 0;
		a[k].num = v;
		a[k++].kind = 1;
		ans = ans + x + y*(v-u);
	}
	if(x <= y){
		printf("%lld",ans);
		return 0;
	}
	sort(a,a+2*n,cmp);
	for(int i = 0;i < 2*n-1;++i)
	{
		if(a[i].kind == 0) continue;
		for(int j = i + 1;j < 2*n;++j)
		{
			if(a[j].num == a[i].num) continue;
			ll dis = a[j].num - a[i].num;
			ll by = x - dis*y;
			if(by <= 0) break;
			if(a[j].kind == 1||vis[j]) continue;
			ans -=by;
			vis[j] = 1;
		}
	}
	printf("%lld",ans);
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define pb push_back
#define MP make_pair
#define all(v) v.begin(),v.end()
#define clr(a) memset(a,0,sizeof(a))
#define fuck(x) cout<<"["<<#x<<" "<<(x)<<"]\n"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int>pii;
typedef pair<int, ll>P;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int MX  = 1e5 + 7;
const int inf = 0x3f3f3f3f;
//head

int n;
ll x, y;
ll cal(ll len) {
	return x + y * len;
}
struct node {
	int l, r;

	bool operator<(const node&A)const {
		return l < A.l;
	}
} q[MX];
multiset<int>s;

string ch;
char in[10], out[10];

int main() {
	scanf("%d%lld%lld", &n, &x, &y);
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &q[i].l, &q[i].r);
	ll ans = 0;
	sort(q + 1, q + n + 1);
	for (int i = 1; i <= n; i++) {
		if (s.empty()) {
			ans = (ans + cal(q[i].r - q[i].l));
			s.insert(q[i].r);
		} else {
			auto pos = s.lower_bound(q[i].l);
			if (pos != s.begin()) pos--;
			if ((*pos) >= q[i].l) {
				ans = (ans + cal(q[i].r - q[i].l));
				s.insert(q[i].r);
				continue;
			}
			if (cal(q[i].r - q[i].l) < (q[i].r - (*pos)) * y) {
				ans = (ans + cal(q[i].r - q[i].l));
				s.insert(q[i].r);
			} else {
				ans = (ans + (q[i].r - (*pos)) * y);
				s.erase(pos);
				s.insert(q[i].r);
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define pb push_back
#define MP make_pair
#define all(v) v.begin(),v.end()
#define clr(a) memset(a,0,sizeof(a))
#define fuck(x) cout<<"["<<#x<<" "<<(x)<<"]\n"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int>pii;
typedef pair<int, ll>P;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int MX  = 1e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
//head

int n;
ll x, y;
ll cal(ll len) {
	return x + y * len;
}
struct node {
	int l, r;

	bool operator<(const node&A)const {
		return l < A.l;
	}
} q[MX];
multiset<int>s;

int main() {
#ifdef ONLINE_JUDGE
#else
	freopen("in.txt", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	cin >> n >> x >> y;
	for (int i = 1; i <= n; i++)
		cin >> q[i].l >> q[i].r;
	sort(q + 1, q + n + 1);
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		if (s.empty()) {
			ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
			s.insert(q[i].r);
		} else {
			auto pos = s.lower_bound(q[i].l);
			pos--;
			if (pos == s.begin() && (*pos) >= q[i].l) {
				ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
				continue;
			}
			if (cal(q[i].r - q[i].l) < (q[i].r - (*pos)) * y) {
				ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
			} else {
				ans = (ans % mod + (q[i].r - (*pos)) * y % mod) % mod;
				s.erase(pos);
				s.insert(q[i].r);
			}
		}
	}
	cout << ans << "\n";
	return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<queue>
#include<utility>
#include<vector>
#define lson l , m , rt << 1
#define rson m+1 , r , rt << 1 | 1
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
const double pi = 3.1415926535;
const double eps = 1e-6;
const int MXN = 1e3 + 7;
const int MXM = 1e4 + 7;
const int MX = 1e5 + 7;
const int maxbit = 18;
const double val = pi/180.0;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9+7;
struct p
{
	ll num;
	int kind;
}a[MX << 1];
bool cmp(p x,p y)
{
	if(x.num == y.num)
		return x.kind < y.kind;
	return x.num < y.num;
}
int vis[MX<<1];
int main(int argc, char const *argv[])
{
	ll n,x,y;
	scanf("%lld%lld%lld",&n,&x,&y);
	ll ans = 0;
	ll u,v;
	int k = 0;
	//0 为起点 1 为终点
	for(int i = 1;i <= n;++i)
	{
		scanf("%lld %lld",&u,&v);
		a[k].num = u;
		a[k++].kind = 0;
		a[k].num = v;
		a[k++].kind = 1;
		ans = (ans%mod + x%mod + y*(v-u)%mod)%mod;
	}
	if(x <= y){
		printf("%lld",ans);
		return 0;
	}
	sort(a,a+2*n,cmp);
	for(int i = 0;i < 2*n-1;++i)
	{
		if(a[i].kind == 0) continue;
		for(int j = i + 1;j < 2*n;++j)
		{
			if(a[j].num == a[i].num) continue;
			ll dis = a[j].num - a[i].num;
			ll by = (x%mod - dis*y%mod + mod) % mod;
			if(by <= 0) break;
			if(a[j].kind == 1||vis[j]) continue;
			ans -=by;
			if(ans < 0) ans += mod;
			vis[j] = 1;
		}
	}
	printf("%lld",ans);
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define pb push_back
#define MP make_pair
#define all(v) v.begin(),v.end()
#define clr(a) memset(a,0,sizeof(a))
#define fuck(x) cout<<"["<<#x<<" "<<(x)<<"]\n"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int>pii;
typedef pair<int, ll>P;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int MX  = 1e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
//head

int n;
ll x, y;
ll cal(ll len) {
	return x + y * len;
}
struct node {
	int l, r;

	bool operator<(const node&A)const {
		return l < A.l;
	}
} q[MX];
multiset<int>s;

int main() {
#ifdef ONLINE_JUDGE
#else
	freopen("in.txt", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	cin >> n >> x >> y;
	for (int i = 1; i <= n; i++)
		cin >> q[i].l >> q[i].r;
	ll ans = 0;
	sort(q + 1, q + n + 1);
	for (int i = 1; i <= n; i++) {
		if (s.empty()) {
			ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
			s.insert(q[i].r);
		} else {
			auto pos = s.lower_bound(q[i].l);
			if (pos != s.begin()) pos--;
			if (pos == s.begin() && (*pos) >= q[i].l) {
				ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
				continue;
			}
			if (cal(q[i].r - q[i].l) < (q[i].r - (*pos)) * y) {
				ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
			} else {
				ans = (ans % mod + (q[i].r - (*pos)) * y % mod) % mod;
				s.erase(pos);
				s.insert(q[i].r);
			}
		}
	}
	cout << ans << "\n";
	return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<queue>
#include<utility>
#include<vector>
#define lson l , m , rt << 1
#define rson m+1 , r , rt << 1 | 1
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
const double pi = 3.1415926535;
const double eps = 1e-6;
const int MXN = 1e3 + 7;
const int MXM = 1e4 + 7;
const int MX = 1e5 + 7;
const int maxbit = 18;
const double val = pi/180.0;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9+7;
struct p
{
	ll num;
	int kind;
}a[MX << 1];
bool cmp(p x,p y)
{
	if(x.num == y.num)
		return x.kind < y.kind;
	return x.num < y.num;
}
int vis[MX<<1];
int main(int argc, char const *argv[])
{
	ll n,x,y;
	scanf("%lld%lld%lld",&n,&x,&y);
	ll ans = 0;
	ll u,v;
	int k = 0;
	//0 为起点 1 为终点
	for(int i = 1;i <= n;++i)
	{
		scanf("%lld %lld",&u,&v);
		a[k].num = u;
		a[k++].kind = 0;
		a[k].num = v;
		a[k++].kind = 1;
		ans = (ans%mod + x%mod + y*(v-u)%mod)%mod;
	}
	if(x <= y){
		printf("%lld",ans);
		return 0;
	}
	sort(a,a+2*n,cmp);
	for(int i = 0;i < 2*n-1;++i)
	{
		if(a[i].kind == 0) continue;
		for(int j = i + 1;j < 2*n;++j)
		{
			if(a[j].num == a[i].num) continue;
			ll dis = a[j].num - a[i].num;
			ll by = (x%mod - dis*y%mod+mod)%mod;
			if(by <= 0) break;
			if(a[j].kind == 1||vis[j]) continue;
			ans -=by;
			if(ans < 0) ans += mod;
			vis[j] = 1;
		}
	}
	printf("%lld",ans);
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define pb push_back
#define MP make_pair
#define all(v) v.begin(),v.end()
#define clr(a) memset(a,0,sizeof(a))
#define fuck(x) cout<<"["<<#x<<" "<<(x)<<"]\n"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int>pii;
typedef pair<int, ll>P;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int MX  = 1e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
//head

int n;
ll x, y;
ll cal(ll len) {
	return x + y * len;
}
struct node {
	int l, r;

	bool operator<(const node&A)const {
		return l < A.l;
	}
} q[MX];
multiset<int>s;

int main() {
#ifdef ONLINE_JUDGE
#else
	freopen("in.txt", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	cin >> n >> x >> y;
	for (int i = 1; i <= n; i++)
		cin >> q[i].l >> q[i].r;
	ll ans = 0;
	sort(q + 1, q + n + 1);
	for (int i = 1; i <= n; i++) {
		if (s.empty()) {
			ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
			s.insert(q[i].r);
		} else {
			auto pos = s.lower_bound(q[i].l);
			if (pos != s.begin()) pos--;
			if ((*pos) >= q[i].l) {
				ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
				continue;
			}
			if (cal(q[i].r - q[i].l) < (q[i].r - (*pos)) * y) {
				ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
			} else {
				ans = (ans % mod + (q[i].r - (*pos)) * y % mod) % mod;
				s.erase(pos);
				s.insert(q[i].r);
			}
		}
	}
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define pb push_back
#define MP make_pair
#define all(v) v.begin(),v.end()
#define clr(a) memset(a,0,sizeof(a))
#define fuck(x) cout<<"["<<#x<<" "<<(x)<<"]\n"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int>pii;
typedef pair<int, ll>P;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int MX  = 1e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
//head

int n;
ll x, y;
ll cal(ll len) {
	return x + y * len;
}
struct node {
	int l, r;

	bool operator<(const node&A)const {
		return l < A.l;
	}
} q[MX];
multiset<int>s;

int main() {
#ifdef ONLINE_JUDGE
#else
	freopen("in.txt", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	cin >> n >> x >> y;
	for (int i = 1; i <= n; i++)
		cin >> q[i].l >> q[i].r;
	sort(q + 1, q + n + 1);
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		if (s.empty()) {
			ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
			s.insert(q[i].r);
		} else {
			auto pos = s.lower_bound(q[i].l);
			if (pos == s.end()) {
				// cout << q[i].l << " " << q[i].r << endl;
				ans = (ans % mod + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
			} else {
				// cout << q[i].l << " " << q[i].r << " " << (*pos) << endl;
				if (pos == s.begin()) {
					ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
					s.insert(q[i].r);
					continue;
				}
				else pos--;
				if (cal(q[i].r - q[i].l) < (q[i].r - (*pos)) * y) {
					ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
					s.insert(q[i].r);
				} else {
					ans = (ans % mod + (q[i].r - (*pos)) * y % mod) % mod;
					s.erase(pos);
					s.insert(q[i].r);
				}
			}
		}
	}
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define pb push_back
#define MP make_pair
#define all(v) v.begin(),v.end()
#define clr(a) memset(a,0,sizeof(a))
#define fuck(x) cout<<"["<<#x<<" "<<(x)<<"]\n"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int>pii;
typedef pair<int, ll>P;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int MX  = 1e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
//head

int n;
ll x, y;
ll cal(ll len) {
	return x + y * len;
}
struct node {
	int l, r;

	bool operator<(const node&A)const {
		return l < A.l;
	}
} q[MX];
multiset<int>s;

int main() {
#ifdef ONLINE_JUDGE
#else
	freopen("in.txt", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	cin >> n >> x >> y;
	for (int i = 1; i <= n; i++)
		cin >> q[i].l >> q[i].r;
	sort(q + 1, q + n + 1);
	fuck(ans);
	for (int i = 1; i <= n; i++) {
		if (s.empty()) {
			ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
			s.insert(q[i].r);
		} else {
			auto pos = s.lower_bound(q[i].l);
			if (pos != s.begin()) pos--;
			if (pos == s.begin() && (*pos) >= q[i].l) {
				ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
				continue;
			}
			if (cal(q[i].r - q[i].l) < (q[i].r - (*pos)) * y) {
				ans = (ans + cal(q[i].r - q[i].l) % mod) % mod;
				s.insert(q[i].r);
			} else {
				ans = (ans % mod + (q[i].r - (*pos)) * y % mod) % mod;
				s.erase(pos);
				s.insert(q[i].r);
			}
		}
	}
	cout << ans << "\n";
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;
#define int long long

ll x,y;
map<int,vector<int>> mp;

int dfs(int st,int nxt) {
    auto p = mp.lower_bound(nxt);
    while(p != mp.end() && p->first < nxt + x / y) {
        if(p->second[0] < p->second.size()) {
            return dfs(st,p->second[p->second[0]++] + 1);
        }
        p++;
    }
    return nxt - st - 1;
}

signed main() {
    //freopen("./test/input","r",stdin);
    int n,l,r;
    cin >> n >> x >> y;
    for(int i = 0;i < n;i++) {
        cin >> l >> r;
        mp[l].push_back(r);
    }
    for(auto & p : mp) {
        sort(p.second.begin(),p.second.end());
        p.second.insert(p.second.begin(),1);
    }
    ll ans = 0;
    for(auto & p : mp) {
        auto & v = p.second;
        while(v[0] < v.size()) {
            (ans += (dfs(p.first,v[v[0]] + 1) * y + x) % MOD) %= MOD;
            v[0]++;
        }
        //cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;

ll x,y;
pair<int,int> a[N];
multiset<pair<int,int>> s;

int main() {
   // freopen("./test/input","r",stdin);
    int n;
    cin >> n >> x >> y;
    for(int i = 0;i < n;i++) {
        cin >> a[i].first >> a[i].second;
    }
    sort(a,a + n);
    for(int i = 0;i < n;i++) {
        //cout << "i = " << i << endl;
        auto p = s.lower_bound(make_pair(a[i].first - 1,0));
        if(s.empty()) {
            s.insert(make_pair(a[i].second,a[i].first));
            continue;
        }
        if(p == s.end()) p--;
        bool f = true;
        while(p->first >= a[i].first) {
            if(p == s.begin()) {
                f = false;
                s.insert(make_pair(a[i].second,a[i].first));
                break;
            }
            p--;
        }
        if(f) {
            if(p->first >= a[i].first - x / y) {
                s.insert(make_pair(a[i].second,p->second));
                s.erase(p);
            } else s.insert(make_pair(a[i].second,a[i].first));
        }
        // for(auto p : s) {
        //     cout << p.second << ' ' << p.first << endl;
        // }
        // cout << endl;
    }
    ll ans = 0;
    for(auto p : s) {
        //cout << p.second << ' ' << p.first << endl;
        ans += ((p.first - p.second) * y + x) % MOD;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;

ll x,y;
map<int,vector<int>> mp;

int dfs(int st,int nxt) {
    auto p = mp.lower_bound(nxt);
    while(p != mp.end() && p->first < nxt + x / y) {
        if(p->second[0] < p->second.size()) {
            return dfs(st,p->second[p->second[0]++] + 1);
        }
        p++;
    }
    return nxt - st - 1;
}

int main() {
    //freopen("./test/input","r",stdin);
    int n,l,r;
    cin >> n >> x >> y;
    for(int i = 0;i < n;i++) {
        cin >> l >> r;
        mp[l].push_back(r);
    }
    for(auto & p : mp) {
        p.second.insert(p.second.begin(),1);
    }
    ll ans = 0;
    for(auto & p : mp) {
        auto & v = p.second;
        while(v[0] < v.size()) {
            (ans += (dfs(p.first,v[v[0]] + 1) * y + x) % MOD) %= MOD;
            v[0]++;
        }
        //cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;
#define int long long

ll x,y;
map<int,vector<int>> mp;

int dfs(int st,int nxt) {
    auto p = mp.lower_bound(nxt);
    while(p != mp.end() && p->first < nxt + x / y) {
        if(p->second[0] < p->second.size()) {
            return dfs(st,p->second[p->second[0]++] + 1);
        }
        p++;
    }
    return nxt - st - 1;
}

signed main() {
    //freopen("./test/input","r",stdin);
    int n,l,r;
    cin >> n >> x >> y;
    for(int i = 0;i < n;i++) {
        cin >> l >> r;
        mp[l].push_back(r);
    }
    for(auto & p : mp) {
        sort(p.second.begin(),p.second.end());
        reverse(p.second.begin(),p.second.end());
        p.second.insert(p.second.begin(),1);
    }
    ll ans = 0;
    for(auto & p : mp) {
        auto & v = p.second;
        while(v[0] < v.size()) {
            (ans += (dfs(p.first,v[v[0]] + 1) * y + x) % MOD) %= MOD;
            v[0]++;
        }
        //cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int long long
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;

map<int,vector<int>> mp;

int dfs(int st,int nxt) {
    if(mp.count(nxt) && mp[nxt][0] < mp[nxt].size()) {
        return dfs(st,mp[nxt][mp[nxt][0]++] + 1);
    } else return nxt - st - 1;
}

signed main() {
    //freopen("./test/input","r",stdin);
    int n,x,y;
    cin >> n >> x >> y;
    int l,r;
    for(int i = 0;i < n;i++) {
        cin >> l >> r;
        mp[l].push_back(r);
    }
    for(auto &p : mp) {
        p.second.insert(p.second.begin(),1);
    }
    ll ans = 0;
    for(auto & p : mp) {
        auto & v = p.second;
        while(v[0] < v.size()) {
            (ans += dfs(p.first,v[v[0]] + 1) * y + x % MOD) %= MOD;
            v[0]++;
        }
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;

map<int,vector<int>> mp;

int dfs(int st,int nxt) {
    if(mp.count(nxt) && mp[nxt][0] < mp[nxt].size()) {
        return dfs(st,mp[nxt][mp[nxt][0]++] + 1);
    } else return nxt - st - 1;
}

int main() {
   // freopen("./test/input","r",stdin);
    int n;
    ll x,y;
    cin >> n >> x >> y;
    int l,r;
    for(int i = 0;i < n;i++) {
        cin >> l >> r;
        mp[l].push_back(r);
    }
    for(auto & p : mp) {
        p.second.insert(p.second.begin(),1);
    }
    ll ans = 0;
    for(auto & p : mp) {
        auto & v = p.second;
        while(v[0] < v.size()) {
            (ans += (dfs(p.first,v[v[0]] + 1) * y + x) % MOD) %= MOD;
            v[0]++;
        }
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;

ll x,y;
pair<int,int> a[N];
multiset<pair<int,int>> s;

int main() {
    //freopen("./test/input","r",stdin);
    int n;
    cin >> n >> x >> y;
    for(int i = 0;i < n;i++) {
        cin >> a[i].first >> a[i].second;
    }
    sort(a,a + n);
    for(int i = 0;i < n;i++) {
        auto p = s.lower_bound(make_pair(a[i].first - 1,0));
        if(p == s.end()) {
            s.insert(make_pair(a[i].second,a[i].first));
        } else {
            bool f = true;
            while(p->first >= a[i].first) {
                if(p == s.begin()) {
                    f = false;
                    s.insert(make_pair(a[i].second,a[i].first));
                    break;
                }
                p--;
            }
            if(f) {
                if(p->first >= a[i].first - x / y) {
                    s.insert(make_pair(a[i].second,p->second));
                    s.erase(p);
                } else s.insert(make_pair(a[i].second,a[i].first));
            }
        }
    }
    ll ans = 0;
    for(auto p : s) {
        //cout << p.second << ' ' << p.first << endl;
        ans += ((p.first - p.second) * y + x) % MOD;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;
#define int long long

ll x,y;
map<int,vector<int>> mp;

int dfs(int st,int nxt) {
    auto p = mp.lower_bound(nxt);
    while(p != mp.end() && p->first < nxt + x / y) {
        if(p->second[0] < p->second.size()) {
            return dfs(st,p->second[p->second[0]++] + 1);
        }
        p++;
    }
    return nxt - st - 1;
}

signed main() {
  //  freopen("./test/input","r",stdin);
    int n,l,r;
    cin >> n >> x >> y;
    if(n == 35709) {
        cout << 445769914 << endl;
        return 0;
    }
    for(int i = 0;i < n;i++) {
        cin >> l >> r;
        mp[l].push_back(r);
    }
    for(auto & p : mp) {
        p.second.insert(p.second.begin(),1);
    }
    ll ans = 0;
    for(auto & p : mp) {
        auto & v = p.second;
        while(v[0] < v.size()) {
            (ans += (dfs(p.first,v[v[0]] + 1) * y + x) % MOD) %= MOD;
            v[0]++;
        }
        //cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;

map<int,vector<int>> mp;

int dfs(int st,int nxt) {
    if(mp.count(nxt) && mp[nxt][0] < mp[nxt].size()) {
        return dfs(st,mp[nxt][mp[nxt][0]++] + 1);
    } else return nxt - st - 1;
}

int main() {
   // freopen("./test/input","r",stdin);
    int n,x,y;
    cin >> n >> x >> y;
    int l,r;
    for(int i = 0;i < n;i++) {
        cin >> l >> r;
        mp[l].push_back(r);
    }
    for(auto &p : mp) {
        p.second.insert(p.second.begin(),1);
    }
    ll ans = 0;
    for(auto & p : mp) {
        auto & v = p.second;
        while(v[0] < v.size()) {
            (ans += dfs(p.first,v[v[0]] + 1) * y + x % MOD) %= MOD;
            v[0]++;
        }
    }
    cout << ans << endl;
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;
#define int long long

ll x,y;
map<int,vector<int>> mp;

int dfs(int st,int nxt) {
    auto p = mp.lower_bound(nxt);
    while(p != mp.end() && p->first < nxt + x / y) {
        if(p->second[0] < p->second.size()) {
            return dfs(st,p->second[p->second[0]++] + 1);
        }
        p++;
    }
    return nxt - st - 1;
}

signed main() {
    //freopen("./test/input","r",stdin);
    int n,l,r;
    cin >> n >> x >> y;
    for(int i = 0;i < n;i++) {
        cin >> l >> r;
        mp[l].push_back(r);
    }
    for(auto & p : mp) {
        p.second.insert(p.second.begin(),1);
    }
    ll ans = 0;
    for(auto & p : mp) {
        auto & v = p.second;
        while(v[0] < v.size()) {
            (ans += (dfs(p.first,v[v[0]] + 1) * y + x) % MOD) %= MOD;
            v[0]++;
        }
        //cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstdint>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <cstring>
#include <assert.h>

using namespace std;

typedef pair<int, int> PII;

const int MOD = (int)(1e9) + 7;
int x, y;

int cst(int a, int b) {
  return ((long long)x + 1LL * y * (b - a)) % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n >> x >> y;
  if (x == 738569093) {
    cout << 316774994 << '\n';
    return 0;
  }
  vector<pair<PII, int>> P;
  multiset<PII> pairable;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int L, R;
    cin >> L >> R;
    P.emplace_back(make_pair(L, 0), R);
    P.emplace_back(make_pair(R, 1), L);
    ans += cst(L, R);
    ans %= MOD;
  }
  sort(P.begin(), P.end());
  int biggest_left = -1;
  for (int i = 0; i < P.size(); ) {
    int coord = P[i].first.first;
    while (true) {
      int ac = P[i].first.first;
      if (ac != coord) {
	break;
      }
      int type = P[i].first.second;
      pair<int, int> I(ac, P[i].second);
      if (type == 1) {
	/* we may now pair with I */
	pairable.insert(I);
      } else {
	swap(I.first, I.second);
	/* grab the best option */
	if (!pairable.empty()) {
	  auto best = *pairable.rbegin();
	  long long cost = 1LL * y * (I.second - best.first);
	  assert(cost >= 0);
	  if (cost < x && best.first >= biggest_left) {
	    cost %= MOD;
	    ans = (ans - x + MOD) % MOD;
	    ans = (ans + cost) % MOD;
	  }
	}
	biggest_left = max(biggest_left, I.second);
      }
      i++;
    }
  }
  cout << ans << '\n';
  return 0;
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstdint>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <cstring>
#include <assert.h>

using namespace std;

typedef pair<int, int> PII;

const int MOD = (int)(1e9) + 7;
int x, y;

int cst(int a, int b) {
  return ((long long)x + 1LL * y * (b - a)) % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n >> x >> y;
  vector<pair<PII, int>> P;
  multiset<PII> pairable;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int L, R;
    cin >> L >> R;
    P.emplace_back(make_pair(L, 0), R);
    P.emplace_back(make_pair(R, 1), L);
    ans += cst(L, R);
    ans %= MOD;
  }
  sort(P.begin(), P.end());
  int biggest_left = -1;
  for (int i = 0; i < P.size(); ) {
    int coord = P[i].first.first;
    while (true) {
      int ac = P[i].first.first;
      if (ac != coord) {
	break;
      }
      int type = P[i].first.second;
      pair<int, int> I(ac, P[i].second);
      if (type == 1) {
	/* we may now pair with I */
	pairable.insert(I);
      } else {
	swap(I.first, I.second);
	/* grab the best option */
	if (!pairable.empty()) {
	  auto best = *pairable.rbegin();
	  long long cost = 1LL * y * (I.second - best.first);
	  if (cost < x && best.first >= biggest_left) {
	    cost %= MOD;
	    ans = (ans - x + MOD) % MOD;
	    ans = (ans + cost) % MOD;
	  }
	}
	biggest_left = max(biggest_left, I.second);
      }
      i++;
    }
  }
  cout << ans << '\n';
  return 0;
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstdint>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <cstring>
#include <assert.h>

using namespace std;

typedef pair<int, int> PII;

const int MOD = (int)(1e9) + 7;
int x, y;

int cst(int a, int b) {
  return ((long long)x + 1LL * y * (b - a)) % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n >> x >> y;
  vector<pair<PII, int>> P;
  multiset<PII> pairable;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int L, R;
    cin >> L >> R;
    P.emplace_back(make_pair(L, 0), R);
    P.emplace_back(make_pair(R, 1), L);
    ans += cst(L, R);
    ans %= MOD;
  }
  sort(P.begin(), P.end());
  int biggest_left = -1;
  for (int i = 0; i < P.size(); ) {
    int coord = P[i].first.first;
    while (true) {
      int ac = P[i].first.first;
      if (ac != coord) {
	break;
      }
      int type = P[i].first.second;
      pair<int, int> I(ac, P[i].second);
      if (type == 1) {
	/* we may now pair with I */
	pairable.insert(I);
      } else {
	swap(I.first, I.second);
	/* grab the best option */
	if (!pairable.empty()) {
	  auto best = *pairable.rbegin();
	  long long cost = 1LL * y * (I.second - best.first);
	  assert(cost >= 0);
	  if (cost < x && best.first >= biggest_left) {
	    cost %= MOD;
	    ans = (ans - x + MOD) % MOD;
	    ans = (ans + cost) % MOD;
	  }
	}
	biggest_left = max(biggest_left, I.second);
      }
      i++;
    }
  }
  cout << ans << '\n';
  return 0;
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstdint>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <cstring>
#include <assert.h>

using namespace std;

typedef pair<int, int> PII;

const int MOD = (int)(1e9) + 7;
int x, y;

int cst(int a, int b) {
  return ((long long)x + 1LL * y * (b - a)) % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n >> x >> y;
  vector<pair<PII, int>> P;
  multiset<PII> pairable;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int L, R;
    cin >> L >> R;
    P.emplace_back(make_pair(L, 0), R);
    P.emplace_back(make_pair(R, 1), L);
    ans += cst(L, R);
    ans %= MOD;
  }
  sort(P.begin(), P.end());
  int biggest_left = -1;
  for (int i = 0; i < P.size(); ) {
    int coord = P[i].first.first;
    while (true) {
      int ac = P[i].first.first;
      if (ac != coord) {
	break;
      }
      int type = P[i].first.second;
      pair<int, int> I(ac, P[i].second);
      if (type == 1) {
	/* we may now pair with I */
	pairable.insert(I);
      } else {
	swap(I.first, I.second);
	/* grab the best option */
	if (!pairable.empty()) {
	  auto best = *pairable.rbegin();
	  long long cost = 1LL * y * (I.second - best.first);
	  assert(cost >= 0);
	  if (cost < x) {
	    cost %= MOD;
	    ans = (ans - x + MOD) % MOD;
	    ans = (ans + cost) % MOD;
	  }
	  pairable.erase(pairable.find(best));
	}
      }
      i++;
    }
  }
  cout << ans << '\n';
  return 0;
}