#include <bits/stdc++.h>   using namespace std;   unsigned long long n, k, c, a, b, d;   multiset<unsigned long long> vn;   multiset<unsigned long long> vk;   unsigned long long mod = 1e9 + 7;   unsigned long long sum = 0;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     cin >> n >> k >> c;     for (int i = 1; i <= n; i++) {       cin >> a >> b;       vn.insert(a), vk.insert(b);       d = c * (b - a);       sum = (sum + d) % mod;     }     multiset<unsigned long long>::iterator it;     while (vn.size() > 0 && vk.size() > 0) {       if (*vn.begin() <= *vk.begin()) {         sum = (k + sum) % mod;         vn.erase(vn.find(*vn.begin()));       } else {         if ((*vn.begin() - *vk.begin()) * c < k) {           int t;           for (it = vk.begin(); it != vk.end(); it++) {             if ((*it) >= *vn.begin()) break;             t = (*it);           }           sum = (sum + (*vn.begin() - t) * c) % mod;           vn.erase(vn.find(*vn.begin()));           vk.erase(vk.find(t));         } else {           vk.erase(*vk.begin());         }       }     }     cout << sum % mod << endl;     return 0;   }   