#include <bits/stdc++.h>
#define optimizar_io ios_base::sync_with_stdio(0);cin.tie(0);
//#define ExecuteTime     cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
#define pi  acos(-1)
#define pb  push_back
#define F   first
#define S   second
#define forr(i,a,b)     for(ll i = (ll)a, asdf = (ll)b ; i < asdf; ++i)
#define fore(i,a,b)     for(ll i = (ll)a, asdf = (ll)b ; i >= asdf; --i)
#define fori(i,a,b,c)   for(ll i = (ll)a, asdf = (ll)b, INC = (ll) c; i < asdf; i+=INC)
#define sz(x)           (ll)x.size()
#define all(a)          a.begin(),a.end()
#define rall(a)         a.rbegin(),a.rend()
#define b_p(n)          __builtin_popcountll(n)

using namespace std;

typedef long long ll;
typedef pair<ll,ll>  pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;

int main(){
    optimizar_io
    //freopen("prueba_input.txt","r",stdin);
    //freopen("prueba_output.txt","w",stdout);
    ll n;
    cin>>n;
    vpll idx(n), idy(n);
    vll dist;
    forr(i,0,n){
        cin>>idx[i].F>>idy[i].F;
        idx[i].S = i;
        idy[i].S = i;
    }
    sort(all(idx));
    sort(all(idy));
    ll index_x = idx[n-1].S;
    ll index_y = idy[n-1].S;
    ll index_x2 = idx[n-2].S;
    ll index_y2 = idy[n-2].S;
    vpll dx, dy, dx2, dy2;
    forr(i,0,n-1){
        dx.pb({ idx[i].S, abs( idx[i].F-idx[n-1].F ) });
        dy.pb({ idy[i].S, abs( idy[i].F-idy[n-1].F ) });
    }
    forr(i,0,n-2){
        dx2.pb({ idx[i].S, abs( idx[i].F-idx[n-2].F ) });
        dy2.pb({ idy[i].S, abs( idy[i].F-idy[n-2].F ) });
    }
    sort(all(dx));
    sort(all(dy));
    sort(all(dx2));
    sort(all(dy2));
    forr(i,0,sz(dx)){
        if(dx[i].F==dy[i].F && index_x==index_y)
            dist.pb(max(dx[i].S, dy[i].S));
        else{
            dist.pb(dx[i].S);
            dist.pb(dy[i].S);
        }
    }
    forr(i,0,sz(dx2)){
        if(dx2[i].F==dy2[i].F && index_x2==index_y2)
            dist.pb(max(dx2[i].S, dy2[i].S));
        else{
            dist.pb(dx2[i].S);
            dist.pb(dy2[i].S);
        }
    }
    sort(rall(dist));
    cout<<dist[1]<<"\n";
    //ExecuteTime;
    return 0;
}
// 2^n - 1LL = 1,2,4,...,2^(n-1).
//See the real limit per case and the total limit
// (n-1)% m + 1LL; - formula n%m==x and special case n%m==0;
// set<char>st(s.begin(),s.end()) // or vector<int> v(all(w.begin(),w.end()))
// put suffix  LL or ULL for constants integers, 1.0f float, 1.0 double, 1.0L long double
// read the question correctly. What are the exact constraints?. 'y' is considered a vowel in special cases.
// n&(n-1)==0 if this is true n is a power of 2.
// look out for SPECIAL CASES (n=1 or n=0 or n=limit ?) and overflow (ll vs int) ARRAY OUT OF BOUNDS

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;typedef double db;
typedef pair<int, int> pii;typedef pair<ll, ll> pll;
typedef pair<int,ll> pil;typedef pair<ll,int> pli;
#define Fi first
#define Se second
#define _Out(a)	cerr<<#a<<" = "<<(a)<<endl
const int INF = 0x3f3f3f3f, MAXN = 1e6 + 50;
const ll LINF = 0x3f3f3f3f3f3f3f3f, MOD = 998244353;
const db Pi = acos(-1), EPS = 1e-6;
void test(){cerr << "\n";}template<typename T,typename...Args>void test(T x,Args...args){cerr<<x<<" ";test(args...);}
inline ll qpow(ll a, ll b){return b?((b&1)?a*qpow(a*a%MOD,b>>1)%MOD:qpow(a*a%MOD,b>>1))%MOD:1;}
inline ll qpow(ll a, ll b,ll c){return b?((b&1)?a*qpow(a*a%c,b>>1,c)%c:qpow(a*a%c,b>>1,c)) %c:1;}
inline ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
inline ll cede(ll a,ll b){if(b<0)return cede(-a,-b);if(a<0)return a/b;return (a+b-1)/b;}
inline ll flde(ll a,ll b){if(b<0)return flde(-a,-b);if(a<0)return (a-b+1)/b;return a/b;}
inline int sign(db x){return x<-EPS ? -1:x>EPS;}
inline int dbcmp(db l,db r){return sign(l - r);}
namespace Fast_IO{ //orz laofu
    const int MAXL((1 << 18) + 1);int iof, iotp;
    char ioif[MAXL], *ioiS, *ioiT, ioof[MAXL],*iooS=ioof,*iooT=ioof+MAXL-1,ioc,iost[55];
    char Getchar(){
        if (ioiS == ioiT){
            ioiS=ioif;ioiT=ioiS+fread(ioif,1,MAXL,stdin);return (ioiS == ioiT ? EOF : *ioiS++);
        }else return (*ioiS++);
    }
    void Write(){fwrite(ioof,1,iooS-ioof,stdout);iooS=ioof;}
    void Putchar(char x){*iooS++ = x;if (iooS == iooT)Write();}
    inline int read(){
        int x=0;for(iof=1,ioc=Getchar();(ioc<'0'||ioc>'9')&&ioc!=EOF;)iof=ioc=='-'?-1:1,ioc=Getchar();
        if(ioc==EOF)Write(),exit(0);
        for(x=0;ioc<='9'&&ioc>='0';ioc=Getchar())x=(x<<3)+(x<<1)+(ioc^48);return x*iof;
    }
    inline long long read_ll(){
        long long x=0;for(iof=1,ioc=Getchar();(ioc<'0'||ioc>'9')&&ioc!=EOF;)iof=ioc=='-'?-1:1,ioc=Getchar();
        if(ioc==EOF)Write(),exit(0);
        for(x=0;ioc<='9'&&ioc>='0';ioc=Getchar())x=(x<<3)+(x<<1)+(ioc^48);return x*iof;
    }
    void Getstr(char *s, int &l){
        for(ioc=Getchar();ioc==' '||ioc=='\n'||ioc=='\t';)ioc=Getchar();
        if(ioc==EOF)Write(),exit(0);
        for(l=0;!(ioc==' '||ioc=='\n'||ioc=='\t'||ioc==EOF);ioc=Getchar())s[l++]=ioc;s[l] = 0;
    }
    template <class Int>void Print(Int x, char ch = '\0'){
        if(!x)Putchar('0');if(x<0)Putchar('-'),x=-x;while(x)iost[++iotp]=x%10+'0',x/=10;
        while(iotp)Putchar(iost[iotp--]);if (ch)Putchar(ch);
    }
    void Putstr(const char *s){for(int i=0,n=strlen(s);i<n;++i)Putchar(s[i]);}
} // namespace Fast_IO
using namespace Fast_IO;
ll fac[MAXN],invfac[MAXN];

void init()
{
    fac[0]=1;for(int i=1;i<MAXN;i++)fac[i]=fac[i-1]*i%MOD;
    invfac[MAXN-1]=qpow(fac[MAXN-1],MOD-2);
    for(int i=MAXN-2;i>=0;i--)invfac[i]=invfac[i+1]*(i+1)%MOD;

}
inline ll C(int n,int m)
{
    if(m<0||m>n)return 0;
    return fac[n]*invfac[m]%MOD*invfac[n-m]%MOD;
}
ll tot[333];
void work()
{
    int n=read(),k=read();
    for(int i=1;i<=n;i++)
    {
        ll x=read();
        ll now=1;
        for(int j=0;j<=k;j++)
        {
            tot[j]=(tot[j]+now)%MOD;
            now=now*x%MOD;
        }
    }
    ll mi2=1;
    for(int i=1;i<=k;i++)
    {
        mi2=mi2*2%MOD;
        ll ans=0;
        for(int j=0;j<=i;j++)
        {
            ans=(ans+tot[j]*tot[i-j]%MOD*C(i,j)%MOD)%MOD;
        }
        ans=(ans-tot[i]*mi2%MOD+MOD)*qpow(2,MOD-2)%MOD;
        printf("%lld\n",ans);
    }
}
int main()
{
    init();
    //std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    //int T=read();for(int cas=1;cas<=T;cas++)
    //int T;scanf("%d",&T);for(int i=1;i<=T;i++)
    work();
    // Write();
}

/**
2
5 3 6
3 1 2 4 5

*/