#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll,ll>;
using pld = pair<ld,ld>;
using vll = vector<ll>;
using vld = vector<ld>;
using vstr = vector<string>;
#define _GLIBCXX_DEBUG
#define rep(j, m) for (ll j = 0; j < (ll)(m); j++)
#define rep2(i, l, n) for (ll i = l; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
const ld PI = 3.1415926535897932;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
vll dx = {-1,0,1,0};
vll dy = {0,-1,0,1};
vll Dx = {-1,-1,-1,0,0,1,1,1};
vll Dy = {-1,0,1,-1,1,-1,0,1};
const ll INF = 1000000000000000;

int main() {    
   ll N;
   cin >> N;
   vector<pll> X(N);
   vector<pll> Y(N);
   rep(i,N) {
      cin >> X[i].first >> Y[i].first;
      X[i].second = i;
      Y[i].second = i;
   }
   sort(all(X));
   sort(all(Y));
   ll x1 = X[N - 1].first - X[0].first;
   ll y1 = Y[N - 1].first - Y[0].first;
   ll x21 = X[N - 2].first - X[0].first;
   ll y21 = Y[N - 2].first - Y[0].first;
   ll x22 = X[N - 1].first - X[1].first;
   ll y22 = Y[N - 1].first - Y[1].first;
   if (x1 > y1) {
      if ((X[N - 1].second == Y[N - 1].second && X[0].second == Y[0].second)||
      (X[N - 1].second == Y[0].second && X[0].second == Y[N - 1].second)) {
         cout << max(max(x21,x22),max(y21,y22)) << endl;
      }
      else {
         cout << max(x21,max(x22,y1)) << endl;
      }
   }
   else {
      if ((X[N - 1].second == Y[N - 1].second && X[0].second == Y[0].second)||
      (X[N - 1].second == Y[0].second && X[0].second == Y[N - 1].second)) {
         cout << max(max(x21,x22),max(y21,y22)) << endl;
      }
      else {
         cout << max(x1,max(y21,y22)) << endl;
      }
   }
}

#include <bits/stdc++.h>

using namespace std;

#define il inline
#define re register
#define rep(i, s, e) for (re int i = s; i <= e; ++i)
#define drep(i, s, e) for (re int i = s; i >= e; --i)
#define file(a) freopen(#a".in", "r", stdin), freopen(#a".out", "w", stdout)

const int mod = 998244353;
const int inv2 = (mod + 1) >> 1;

const int N = 200010;

il int read() {
    int x = 0; bool f = true; char c = getchar();
    while (!isdigit(c)) {if (c == '-') f = false; c = getchar();}
    while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
    return f ? x : -x;
}

il int inc(int a, int b) { return (a += b) >= mod ? a - mod : a; }
il int dec(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
il int mul(int a, int b) { return 1ll * a * b % mod; }

int inv[N];
il void init(int w) {
    inv[1] = 1;
    rep(i, 2, w) inv[i] = mod - mul(mod / i, inv[mod % i]);
}

int n, m, f[N];
int tot, p[N], minv[N];
bool isnp[N];

il void filt() {
    f[1] = 1;
    rep(i, 2, m) {
        if (!isnp[i]) p[++tot] = i, f[i] = n, minv[i] = 1;
        for (re int j = 1; j <= tot && i * p[j] <= m; ++j) {
            isnp[i * p[j]] = true;
            if (i % p[j]) f[i * p[j]] = mul(f[i], n), minv[i * p[j]] = 1;
            else { f[i * p[j]] = mul(f[i], mul(n + minv[i], inv[minv[i] + 1])), minv[i * p[j]] = minv[i] + 1; break; }
        }
    }
}

int main() {
    n = read(), m = read(), init(200000);
    filt();
    int ans = 0;
    rep(i, 1, m) ans = inc(ans, f[i]);
    printf("%d\n", ans);
    return 0;
}