#include <iostream>
#include <math.h>
using namespace std;
bool is_prime(int);

int main()
{
    int a;
    cin>>a;
    if(a==2||a==1)
    {
        cout<<1<<'\n';
    }

    else
    {
        cout<<2<<'\n';
    }
    for(int i=1;i<=a;i++)
    {
        if(is_prime(i))
        {
            cout<<1<<' ';
        }
        else
        {
            cout<<2<<' ';
        }
    }
}
bool is_prime(int num)
{
	int i;
	if(num==1)
    {
		return 1;
	}
	else{
    for(i=2;i<=sqrt(num);i++)
    {
        if(num%i==0)
        {
				return 0;
        }
    }
	}
	return 1;
}


#include <iostream>
#include <math.h>
using namespace std;
bool is_prime(int);

int main()
{
    int a;
    cin>>a;
    if(a==2)
    {
        cout<<1<<'\n';
    }
    else
    {
        cout<<2<<'\n';
    }
    for(int i=1;i<=a;i++)
    {
        if(is_prime(i))
        {
            cout<<2<<' ';
        }
        else
        {
            cout<<1<<' ';
        }
    }
}
bool is_prime(int num)
{
	int i;
	if(num==1)
    {
		return 0;
	}
	else{
    for(i=2;i<sqrt(num);i++)
    {
        if(num%i==0)
        {
				return 0;
        }
    }
	}
	return 1;
}


#include <iostream>
#include <math.h>
using namespace std;
bool is_prime(int);

int main()
{
    int a;
    cin>>a;
    if(a==2||a==1)
    {
        cout<<1<<'\n';
    }

    else
    {
        cout<<2<<'\n';
    }
    for(int i=2;i<=a;i++)
    {
        if(is_prime(i))
        {
            cout<<1<<' ';
        }
        else
        {
            cout<<2<<' ';
        }
    }
}
bool is_prime(int num)
{
	int i;
	if(num==1)
    {
		return 1;
	}
	else{
    for(i=2;i<=sqrt(num);i++)
    {
        if(num%i==0)
        {
				return 0;
        }
    }
	}
	return 1;
}


#include <math.h>
using namespace std;
bool is_prime(int);

int main()
{
    int a;
    cin>>a;
    if(a==2||a==1)
    {
        cout<<1<<'\n';
    }

    else
    {
        cout<<2<<'\n';
    }
    for(int i=1;i<=a;i++)
    {
        if(is_prime(i))
        {
            cout<<1<<' ';
        }
        else
        {
            cout<<2<<' ';
        }
    }
}
bool is_prime(int num)
{
	int i;
	if(num==1)
    {
		return 1;
	}
	else{
    for(i=2;i<sqrt(num);i++)
    {
        if(num%i==0)
        {
				return 0;
        }
    }
	}
	return 1;
}


#include <iostream>
#include <math.h>
using namespace std;
int is_prime(int);

int main()
{
    int a;
    cin>>a;
    if(a==2)
    {
        cout<<1<<'\n';
    }
    else
    {
        cout<<2<<'\n';
    }
    for(int i=1,i<=a,i++)
    {
        if(is_prime(i))
        {
            cout<<2<<' ';
        }
        else
        {
            cout<<1<<' ';
        }
    }
}
bool is_prime(int num)
{
	int i;
	if(num==1)
    {
		return 0;
	}
	else{
    for(i=2;i<sqrt(num);i++)
    {
        if(num%i==0)
        {
				return 0;
        }
    }
	}
	return 1;
}


#include<bits/stdc++.h>
using namespace std;
int primes[100005];
//int m=100002;
int main()
{
  int n,i,j;
  cin>>n;
  if(n==1)
  {
  	cout<<1<<endl;
  	cout<<1;
  	return 0;
  }
  for(i=0;i<=n+1;++i)primes[i]=1;

  primes[0]=0;
  primes[1]=0;

  for(i=2;i*i<=n+1;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			primes[i*j]=0;
  		}
  	}
  }
  vector<int>ans(n+2);
  for(i=0;i<ans.size();++i)ans[i]=1;
  for(i=2;i<=(n+1)/2;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			ans[i*j]=2;
  		}
  	}
  }
    cout<<2<<endl;
   for(i=2;i<=n+1;++i)cout<<ans[i]<<" ";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int primes[100005];
//int m=100002;
int main()
{
  int n;
  long long int i,j;
  cin>>n;
  if(n==1)
  {
  	cout<<1<<endl;
  	cout<<1;
  	return 0;
  }
  for(i=0;i<=n+1;++i)primes[i]=1;

  primes[0]=0;
  primes[1]=0;

  for(i=2;i*i<=n+1;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			primes[i*j]=0;
  		}
  	}
  }
  vector<int>ans(n+2);
  for(i=0;i<ans.size();++i)ans[i]=1;
  for(i=2;i<=(n+1)/2;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			ans[i*j]=2;
  		}
  	}
  }
    cout<<2<<endl;
   for(i=2;i<=n+1;++i)cout<<ans[i]<<" ";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int primes[100005];
//int m=100002;
int main()
{
  int n;
  long long int i,j;
  cin>>n;
  if(n==1)
  {
  	cout<<1<<endl;
  	cout<<1;
  	return 0;
  }
  else if(n==2)
  {
  	cout<<1<<endl;
  	cout<<1<<" "<<1;
  	return 0;
  }
  for(i=0;i<=n+1;++i)primes[i]=1;

  primes[0]=0;
  primes[1]=0;

  for(i=2;i*i<=n+1;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			primes[i*j]=0;
  		}
  	}
  }
  vector<int>ans(n+2);
  for(i=0;i<ans.size();++i)ans[i]=1;
  for(i=2;i<=(n+1)/2;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			ans[i*j]=2;
  		}
  	}
  }
    cout<<2<<endl;
   for(i=2;i<=n+1;++i)cout<<ans[i]<<" ";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int primes[100005];
//int m=100002;
int main()
{
  int n,i,j;
  cin>>n;
  if(n==1)
  {
  	cout<<1;
  	return 0;
  }
  for(i=0;i<=n+1;++i)primes[i]=1;

  primes[0]=0;
  primes[1]=0;

  for(i=2;i*i<=n+1;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			primes[i*j]=0;
  		}
  	}
  }
  vector<int>ans(n+2);
  for(i=0;i<ans.size();++i)ans[i]=1;
  for(i=2;i<=(n+1)/2;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			ans[i*j]=2;
  		}
  	}
  }
    cout<<2<<endl;
   for(i=2;i<=n+1;++i)cout<<ans[i]<<" ";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int primes[100002];
int m=100002;
int main()
{
  int n,i,j;
  cin>>n;
  for(i=0;i<=m;++i)primes[i]=1;

  primes[0]=0;
  primes[1]=0;

  for(i=2;i*i<=n+1;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			primes[i*j]=0;
  		}
  	}
  }
  vector<int>ans(n+2);
  for(i=0;i<ans.size();++i)ans[i]=1;
  for(i=2;i<=(n+1)/2;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			ans[i*j]=2;
  		}
  	}
  }
    cout<<2<<endl;
   for(i=2;i<=n+1;++i)cout<<ans[i]<<" ";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int primes[100005];
//int m=100002;
int main()
{
  int n,i,j;
  cin>>n;
  for(i=0;i<=n+1;++i)primes[i]=1;

  primes[0]=0;
  primes[1]=0;

  for(i=2;i*i<=n+1;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			primes[i*j]=0;
  		}
  	}
  }
  vector<int>ans(n+2);
  for(i=0;i<ans.size();++i)ans[i]=1;
  for(i=2;i<=(n+1)/2;++i)
  {
  	if(primes[i]==1)
  	{
  		for(j=i;i*j<=n+1;++j)
  		{
  			ans[i*j]=2;
  		}
  	}
  }
    cout<<2<<endl;
   for(i=2;i<=n+1;++i)cout<<ans[i]<<" ";

	return 0;
}


#include<iostream>
#include<cmath>
using namespace std ;
int main()
{
    int n ;
    cin >> n ;
   int i , prime[n/2] , x=0 , j , c[n+2]={0} , p  ;
   for(i=2 ; i <=n+1 ; i++){
        int ok=0 ;
    for(j=2 ; j <=sqrt(i); j++){
        if(i%j==0){
            ok=1 ;
            break ;
        }
    }
    if(ok==0){
        prime[x]=i ;
        x++;
        //cout << i << endl;
    }
   }
  for(i=0 ; i <x ; i++){
         p=2;
    for(j=2 ; j <=n+1 ; j ++){
        if(prime[i]==j){
            c[j]=1 ;
        }
        else if( j%prime[i]==0&&c[j]==0){
            c[j]=p ;

        }
    }

  }
  if (n<=2){
  cout << 1 << endl ;}
  else{
     cout << 2 << endl ;
  }
  for(i=2 ; i <n+2 ; i++){
    cout << c[i] << " " ;
  }
}


#include<iostream>
#include<cmath>
using namespace std ;
int main()
{
    int n ;
    cin >> n ;
   int i , prime[n/2] , x=0 , j , c[n+2]={0} , p , mx=-1 ;
   for(i=2 ; i <=n+1 ; i++){
        int ok=0 ;
    for(j=2 ; j <=sqrt(i); j++){
        if(i%j==0){
            ok=1 ;
            break ;
        }
    }
    if(ok==0){
        prime[x]=i ;
        x++;
        //cout << i << endl;
    }
   }
  for(i=0 ; i <x ; i++){
         p=2;
    for(j=2 ; j <=n+1 ; j ++){
        if(prime[i]==j){
            c[j]=1 ;
        }
        else if( j%prime[i]==0&&c[j]==0){
            c[j]=p ;
            p++;
        }
    }
    if(p >mx){
        mx=p ;
    }
  }
  cout << mx-1 << endl ;
  for(i=2 ; i <n+2 ; i++){
    cout << c[i] << " " ;
  }
}


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

typedef long long ll;
#define pb push_back
#define  fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define N ((int)1e5 + 5)
#define mod ((int)1e9 + 7)
#define endl "\n"
#define mini ((int)1e9 + 5)

int main()
{
    fast;
    int n ;
    cin >> n ;
    int prime[N+5]={0} ;
    //vector<int > p ;
    //prime[2]=1 ;
    //cout << "o=" << prime[] << endl ;

   int i , j  ;
   for(i=3 ; i*i <=n+5 ;i=i+2 ){
    if(prime[i]==0){

        for(j=i*i ; j <=n+5 ; j+=(i<<1)){
            prime[j]=2 ;
        }
    }
   }
  for(i=4 ; i<=n+5 ; i=i+2 ){
    prime[i]=2 ;
  }
 /* p.push_back(2) ;
  for(i=3 ; i <=n+1 ; i=i+2){
    if(prime[i]==0){
        p.push_back(i) ;
    }
  }
for(i=0 ; i <p.size() ; i ++){
    cout << p[i] << " " ;
}*/
if(n<=2){
    cout << 1 << endl ;
}
else {

   cout << 2 << endl ;
}

    for( i =2 ; i <=n+1 ; i++){

            if(prime[i]==0){
                cout << 1 << " " ;
            }
            else
        cout << prime[i] << " " ;
    }

}


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

typedef long long ll;
#define pb push_back
#define  fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define N ((int)1e6 + 5)
#define mod ((int)1e9 + 7)
#define endl "\n"
#define mini ((int)1e9 + 5)

int main()
{
    fast;
    int n ;
    cin >> n ;
    int prime[n+2]={0} ;
    prime[2]=1 ;
    //cout << "o=" << prime[] << endl ;

   int i , j  ;
   for(i=3 ; i*i <=n+1 ;i=i+2 ){
    if(prime[i]==0){

        for(j=i*i ; j <=n ; j+=(i<<1)){
            prime[j]=2 ;
        }
    }
   }
  for(i=4 ; i<=n+1 ; i=i+2 ){
    prime[i]=2 ;
  }

    cout << 2 << endl ;

    for( i =2 ; i <=n+1 ; i++){

            if(prime[i]==0){
                cout << 1 << " " ;
            }
            else
        cout << prime[i] << " " ;
    }

}


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

typedef long long ll;
#define pb push_back
#define  fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define N ((int)1e5 + 5)
#define mod ((int)1e9 + 7)
#define endl "\n"
#define mini ((int)1e9 + 5)

int main()
{
    fast;
    int n ;
    cin >> n ;
    int prime[N+5]={0} ;
    //vector<int > p ;
    //prime[2]=1 ;
    //cout << "o=" << prime[] << endl ;

   int i , j  ;
   for(i=3 ; i*i <=n+5 ;i=i+2 ){
    if(prime[i]==0){

        for(j=i*i ; j <=n+5 ; j+=(i<<1)){
            prime[j]=2 ;
        }
    }
   }
  for(i=4 ; i<=n+5 ; i=i+2 ){
    prime[i]=2 ;
  }
 /* p.push_back(2) ;
  for(i=3 ; i <=n+1 ; i=i+2){
    if(prime[i]==0){
        p.push_back(i) ;
    }
  }
for(i=0 ; i <p.size() ; i ++){
    cout << p[i] << " " ;
}*/

   cout << 2 << endl ;

    for( i =2 ; i <=n+1 ; i++){

            if(prime[i]==0){
                cout << 1 << " " ;
            }
            else
        cout << prime[i] << " " ;
    }

}


#include<iostream>
#include<cmath>
using namespace std ;
int main()
{
    int n ;
    cin >> n ;
   int i , prime[n/2] , x=0 , j , c[n+2]={0} , p  ;
   for(i=2 ; i <=n+1 ; i++){
        int ok=0 ;
    for(j=2 ; j <=sqrt(i); j++){
        if(i%j==0){
            ok=1 ;
            break ;
        }
    }
    if(ok==0){
        prime[x]=i ;
        x++;
        //cout << i << endl;
    }
   }
  for(i=0 ; i <x ; i++){
         p=2;
    for(j=2 ; j <=n+1 ; j ++){
        if(prime[i]==j){
            c[j]=1 ;
        }
        else if( j%prime[i]==0&&c[j]==0){
            c[j]=p ;

        }
    }

  }
  cout << 2 << endl ;
  for(i=2 ; i <n+2 ; i++){
    cout << c[i] << " " ;
  }
}


#include<iostream>
#include<cmath>
using namespace std ;
int main()
{
    int n ;
    cin >> n ;
   int i , prime[n/2] , x=0 , j , c[n+2]={0} , p  ;
    if (n<=2){
  cout << 1 << endl ;}
  else{
     cout << 2 << endl ;
  }
   for(i=2 ; i <=n+1 ; i++){
        int ok=0 ;
    for(j=2 ; j <=sqrt(i); j++){
        if(i%j==0){
            ok=1 ;
            break ;
        }
    }
    if(ok==0){
       c[i]=1 ;

    }
    else{
        c[i]=2 ;
    }
    cout << c[i] << " " ;
   }

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;  cin>>n;
    vector<int> v(n + 2, 0);
    int k = 1;
    for(int i = 2;i <= n + 1;i++){
        if(v[i] == 0){
            v[i] = 1;
            for(int j = i * i;j <= n + 1;j += i){
                k++;
                v[j] = k;
            }
        }
    }
    cout<<k<<endl;
    for(int i = 2;i < n + 2;i++){
        cout<<v[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;  cin>>n;
    vector<int> v(n + 2, 0);
    int k = 1;
    for(int i = 2;i <= n + 1;i++){
        if(v[i] == 0){
            v[i] = 1;
            k = 2;
            for(int j = i * i;j <= n + 1;j += i){

                v[j] = k;
            }
        }
    }
    if(n>2)
		cout<<"2\n";
	else
		cout<<"1\n";
    for(int i = 2;i < n + 2;i++){
        cout<<v[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;  cin>>n;
    vector<int> v(n + 2, 0);
    int k = 1;
    for(int i = 2;i <= n + 1;i++){
        if(v[i] == 0){
            v[i] = 1;
            k = 2;
            for(long long int j = i * 2;j <= n + 1;j += i){

                v[j] = k;
            }
        }
    }
    if(n>2)
		cout<<"2\n";
	else
		cout<<"1\n";
    for(int i = 2;i < n + 2;i++){
        cout<<v[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;  cin>>n;
    vector<int> v(n + 2, 0);
    int k = 1;
    for(int i = 2;i <= n + 1;i++){
        if(v[i] == 0){
            v[i] = 1;
            k = 2;
            for(long long int j = i * i;j <= n + 1;j += i){

                v[j] = k;
            }
        }
    }
    if(n>2)
		cout<<"2\n";
	else
		cout<<"1\n";
    for(int i = 2;i < n + 2;i++){
        cout<<v[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;  cin>>n;
    vector<int> v(n + 2, 0);
    int k = 1;
    for(int i = 2;i <= n + 1;i++){
        if(v[i] == 0){
            v[i] = 1;
            k = 2;
            for(int j = i * i;j <= n + 1;j += i){

                v[j] = k;
            }
        }
    }
    cout<<k<<endl;
    for(int i = 2;i < n + 2;i++){
        cout<<v[i]<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;  cin>>n;
    vector<int> v(n + 2, 0);
    int k = 1;
    for(int i = 2;i <= n + 1;i++){
        k = 1;
        if(v[i] == 0){
            v[i] = 1;
            k = 2;
            for(int j = i * i;j <= n + 1;j += i){

                v[j] = k;
            }
        }
    }
    cout<<k<<endl;
    for(int i = 2;i < n + 2;i++){
        cout<<v[i]<<" ";
    }
    return 0;
}


# include <bits/stdc++.h>
# pragma GCC optimize("Ofast")

# define pb push_back
# define ll long long
# define fi first
# define se second
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL)

using namespace std;

const int N = 50 + 7;
const int mod = 1e9 + 7;

int n, cnt, ans, x;

int main()
{
    /// Author: Dilshod--Imomov
    cin >> n;
    vector < bool > primes(n, true);
    primes[1] = false;
    for ( int i = 2; i * i <= n + 1; i++ ) {
        if ( primes[i] ) {
            for ( int j = i * i; j <= n + 1; j += i ) {
                primes[j] = false;
            }
        }
    }
    vector < int > ans(n + 2, 1);
    for ( int j = 2; j <= n + 1; j++ ) {
        if ( primes[j] ) {
            for ( int i = j * j; i <= n + 1; i += j ) {
                ans[i] = 2;
            }
        }
    }
    cout << 2 << endl;
    for ( int i = 2; i <= n + 1; i++ ) cout << ans[i] << ' ';
}


# include <bits/stdc++.h>
# pragma GCC optimize("Ofast")

# define pb push_back
# define ll long long
# define fi first
# define se second
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL)

using namespace std;

const int N = 50 + 7;
const int mod = 1e9 + 7;

int n, cnt, ans, x;

int main()
{
    /// Author: Dilshod--Imomov
    cin >> n;
    vector < bool > primes(n + 3, true);
    primes[1] = false;
    for ( int i = 2; i * i <= n + 1; i++ ) {
        if ( primes[i] ) {
            for ( int j = i * i; j <= n + 1; j += i ) {
                primes[j] = false;
            }
        }
    }
    vector < int > ans(n + 2, 1);
    for ( int j = 2; j <= n + 1; j++ ) {
        if ( primes[j] ) {
            for ( int i = j * j; i <= n + 1; i += j ) {
                ans[i] = 2;
                cnt++;
            }
        }
    }
    if (cnt > 1)
        cout << 2 << endl;
    else cout << 1 << endl;
    for ( int i = 2; i <= n + 1; i++ ) cout << ans[i] << ' ';
}


# include <bits/stdc++.h>
# pragma GCC optimize("Ofast")

# define pb push_back
# define ll long long
# define fi first
# define se second
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL)

using namespace std;

const int N = 50 + 7;
const int mod = 1e9 + 7;

int n, cnt, ans, x;

int main()
{
    /// Author: Dilshod--Imomov
    cin >> n;
    vector < bool > primes(n, true);
    primes[1] = false;
    for ( int i = 2; i * i <= n + 1; i++ ) {
        if ( primes[i] ) {
            for ( int j = i * i; j <= n + 1; j += i ) {
                primes[j] = false;
            }
        }
    }
    vector < int > ans(n + 2, 1);
    for ( int j = 2; j <= n + 1; j++ ) {
        if ( primes[j] ) {
            for ( int i = j * j; j <= n + 1; j += i ) {
                ans[i] = 2;
            }
        }
    }
    cout << 2 << endl;
    for ( int i = 2; i <= n + 1; i++ ) cout << ans[i] << ' ';
}


# include <bits/stdc++.h>
# pragma GCC optimize("Ofast")

# define pb push_back
# define ll long long
# define fi first
# define se second
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL)

using namespace std;

const int N = 50 + 7;
const int mod = 1e9 + 7;

ll n, cnt, ans, x;

int main()
{
    /// Author: Dilshod--Imomov
    cin >> n;
    vector < bool > primes(n + 3, true);
    primes[1] = false;
    for ( ll i = 2; i * i <= n + 1; i++ ) {
        if ( primes[i] ) {
            for ( ll j = i * i; j <= n + 1; j += i ) {
                primes[j] = false;
            }
        }
    }
    vector < int > ans(n + 2, 1);
    for ( ll j = 2; j <= n + 1; j++ ) {
        if ( primes[j] ) {
            for ( ll i = j * j; i <= n + 1; i += j ) {
                ans[i] = 2;
                cnt++;
            }
        }
    }
    if (cnt >= 1)
        cout << 2 << endl;
    else cout << 1 << endl;
    for ( int i = 2; i <= n + 1; i++ ) cout << ans[i] << ' ';
}


# include <bits/stdc++.h>
# pragma GCC optimize("Ofast")

# define pb push_back
# define ll long long
# define fi first
# define se second
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL)

using namespace std;

const int N = 50 + 7;
const int mod = 1e9 + 7;

int n, cnt, ans, x;

int main()
{
    /// Author: Dilshod--Imomov
    cin >> n;
    vector < bool > primes(n + 3, true);
    primes[1] = false;
    for ( int i = 2; i * i <= n + 1; i++ ) {
        if ( primes[i] ) {
            for ( int j = i * i; j <= n + 1; j += i ) {
                primes[j] = false;
            }
        }
    }
    vector < int > ans(n + 2, 1);
    for ( int j = 2; j <= n + 1; j++ ) {
        if ( primes[j] ) {
            for ( int i = j * j; i <= n + 1; i += j ) {
                ans[i] = 2;
            }
        }
    }
    cout << 2 << endl;
    for ( int i = 2; i <= n + 1; i++ ) cout << ans[i] << ' ';
}


# include <bits/stdc++.h>
# pragma GCC optimize("Ofast")

# define pb push_back
# define ll long long
# define fi first
# define se second
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL)

using namespace std;

const int N = 50 + 7;
const int mod = 1e9 + 7;

int n, cnt, ans, x;

int main()
{
    /// Author: Dilshod--Imomov
    cin >> n;
    vector < bool > primes(n + 3, true);
    primes[1] = false;
    for ( int i = 2; i * i <= n + 1; i++ ) {
        if ( primes[i] ) {
            for ( int j = i * i; j <= n + 1; j += i ) {
                primes[j] = false;
            }
        }
    }
    vector < int > ans(n + 2, 1);
    for ( int j = 2; j <= n + 1; j++ ) {
        if ( primes[j] ) {
            for ( int i = j * j; i <= n + 1; i += j ) {
                ans[i] = 2;
                cnt++;
            }
        }
    }
    if (cnt >= 1)
        cout << 2 << endl;
    else cout << 1 << endl;
    for ( int i = 2; i <= n + 1; i++ ) cout << ans[i] << ' ';
}


#include <string>
#include <iostream>
#include <vector>
#include <cmath>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINT(x) for (int i = 0; i < (int)x.size(); i++) std::cout << x[i] << ' '; std::cout << '\n';
#define io std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
const int INF = 1<<29;
typedef long long ll;

std::vector<char> sieve(int n) {
    std::vector<char> isPrime(n+1, true);
    isPrime[0] = isPrime[1] = false;
    for (int i = 2; i <= n; i++) {
        if (isPrime[i] && (ll) i*i <= n) {
            for (int j = i * i; j <= n; j += i)
                isPrime[j] = false;
        }
    }
    return isPrime;
}

void solve(int n) {
    std::vector<char> v = sieve(n+5);
    if (n == 1) {
        std::cout << 1 << '\n' << 1;
        return;
    }
    if (n == 2)  {
        std::cout << 1 << '\n' << 1 << ' ' << 1;
        return;
    }
    else std::cout << 2 << '\n';
    for (int i = 2; i < n + 2; i++) {
        if (v[i])
            std::cout << 2 << ' ';
        else std::cout << 1 << ' ';
    }
}

int main()
{
	io;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    std::cin >> n;
    solve(n);

    #ifndef ONLINE_JUDGE
    std::cout << '\n' << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    #endif
    return 0;
}


#include <string>
#include <iostream>
#include <vector>
#include <cmath>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINT(x) for (int i = 0; i < (int)x.size(); i++) std::cout << x[i] << ' '; std::cout << '\n';
#define io std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
const int INF = 1<<29;
typedef long long ll;

std::vector<char> sieve(int n) {
    std::vector<char> isPrime(n+1, true);
    isPrime[0] = isPrime[1] = false;
    for (int i = 2; i <= n; i++) {
        if (isPrime[i] && (ll) i*i <= n) {
            for (int j = i * i; j <= n; j += i)
                isPrime[j] = false;
        }
    }
    return isPrime;
}

void solve(int n) {
    std::vector<char> v = sieve(n+5);
    for (int i = 2; i < n + 2; i++) {
        if (v[i])
            std::cout << 2 << ' ';
        else std::cout << 1 << ' ';
    }
}

int main()
{
	io;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    std::cin >> n;
    solve(n);

    #ifndef ONLINE_JUDGE
    std::cout << '\n' << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    #endif
    return 0;
}


#include <string>
#include <iostream>
#include <vector>
#include <cmath>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINT(x) for (int i = 0; i < (int)x.size(); i++) std::cout << x[i] << ' '; std::cout << '\n';
#define io std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
const int INF = 1<<29;
typedef long long ll;

void solve(int n) {
    std::cout << n / 2 + !!(n % 2 == 1) << '\n';
    int cur = 1;
    for (int i = 0; i < n; i++) {
        std::cout << cur << ' ';
        if (i % 2 == 1)
            cur++;
    }
}

int main()
{
	io;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    std::cin >> n;
    solve(n);

    #ifndef ONLINE_JUDGE
    std::cout << '\n' << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    #endif
    return 0;
}


#include <string>
#include <iostream>
#include <vector>
#include <cmath>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINT(x) for (int i = 0; i < (int)x.size(); i++) std::cout << x[i] << ' '; std::cout << '\n';
#define io std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
const int INF = 1<<29;
typedef long long ll;

std::vector<char> sieve(int n) {
    std::vector<char> isPrime(n+1, true);
    isPrime[0] = isPrime[1] = false;
    for (int i = 2; i <= n; i++) {
        if (isPrime[i] && (ll) i*i <= n) {
            for (int j = i * i; j <= n; j += i)
                isPrime[j] = false;
        }
    }
    return isPrime;
}

void solve(int n) {
    std::vector<char> v = sieve(n+5);
    if (n <= 2) std::cout << 1 << '\n';
    else std::cout << 2 << '\n';
    for (int i = 2; i < n + 2; i++) {
        if (v[i])
            std::cout << 2 << ' ';
        else std::cout << 1 << ' ';
    }
}

int main()
{
	io;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    std::cin >> n;
    solve(n);

    #ifndef ONLINE_JUDGE
    std::cout << '\n' << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    #endif
    return 0;
}


#include <string>
#include <iostream>
#include <vector>
#include <cmath>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINT(x) for (int i = 0; i < (int)x.size(); i++) std::cout << x[i] << ' '; std::cout << '\n';
#define io std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
const int INF = 1<<29;
typedef long long ll;

void solve(int n) {
    if (n == 1) {
        std::cout << 1 << '\n' << 1;
        return;
    }
    std::cout << 2 << '\n' << 1 << ' ' << 1 << ' ';
    for (int i = 4; i < n+2; i++) {
        if (i % 2 == 0 || i % 3 == 0)
            std::cout << 2 << ' ';
        else std::cout << 1 << ' ';
    }
}

int main()
{
	io;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    std::cin >> n;
    solve(n);

    #ifndef ONLINE_JUDGE
    std::cout << '\n' << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    #endif
    return 0;
}


#include <string>
#include <iostream>
#include <vector>
#include <cmath>
#define DEBUG(x) std::cout << '>' << #x << ':' << x << '\n';
#define PRINT(x) for (int i = 0; i < (int)x.size(); i++) std::cout << x[i] << ' '; std::cout << '\n';
#define io std::ios_base::sync_with_stdio(false);std::cin.tie(NULL);
const int INF = 1<<29;
typedef long long ll;

std::vector<char> sieve(int n) {
    std::vector<char> isPrime(n+1, true);
    isPrime[0] = isPrime[1] = false;
    for (int i = 2; i <= n; i++) {
        if (isPrime[i] && (ll) i*i <= n) {
            for (int j = i * i; j <= n; j += i)
                isPrime[j] = false;
        }
    }
    return isPrime;
}

void solve(int n) {
    std::vector<char> v = sieve(n+5);
    if (n == 1)
        std::cout << 1 << '\n' << 1;
    if (n == 2)
        std::cout << 1 << '\n' << 1 << ' ' << 1;
    else std::cout << 2 << '\n';
    for (int i = 2; i < n + 2; i++) {
        if (v[i])
            std::cout << 2 << ' ';
        else std::cout << 1 << ' ';
    }
}

int main()
{
	io;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    int n;
    std::cin >> n;
    solve(n);

    #ifndef ONLINE_JUDGE
    std::cout << '\n' << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    #endif
    return 0;
}


  /*/ Author:amar1503/*/
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
#define ll long long
#define For(i,n) for(int i=0;i<n;i++)
#define bfor(i,a,b) for(int i=a;i<b;i++)
#define rfor(i,n) for(int i=n-1;i>=0;i--)
#define pb push_back
#define sz(r) r.size()
#define inf INT_MAX
#define mninf INT_MIN
#define sortv(v)  sort(v.begin(),v.end())
#define all(v) (v).begin(),(v).end()
#define Mod 1000000007
#define endl "\n"
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define d5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<endl
#define d6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<endl
#define mp make_pair
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
typedef vector<int> vi;
typedef vector< vector< int > > vvi;
typedef pair <int, int>   pii;
#define ull unsigned long long
bool comp(int a,int b){
return(a<b);
}
/*/-----------------------------Code begins----------------------------------/*/
int main(){
int n;
cin>>n;
if(n==1){
cout<<1<<endl<<1;
return 0;}
bool prime[n+2];
for(int i=0;i<n+2;i++)
prime[i]=1;

prime[0]=prime[1]=0;
for(int i=2;i<=n+1;i++){
if(prime[i]){
for(ll j=i*i;j<=n+1;j+=i)
prime[j]=0;
}}

cout<<2<<endl;
for(int i=2;i<=n+1;i++){
if(prime[i])
cout<<1<<" ";
else cout<<2<<" ";}
return 0;}


#include<iostream>
using namespace std;

int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
if(n==1){
cout<<1<<endl<<1;
return 0;}
if(n==2){
cout<<1<<endl<<1<<" "<<1;
return 0;}
bool prime[n+2];
for(int i=2;i<n+2;i++)
prime[i]=1;
cout<<2<<endl;
for(int i=2;i<=n+1;i++){
if(prime[i]){
for(long long j=i*i;j<=n+1;j+=i)
prime[j]=0;
}
if(prime[i])
cout<<1<<" ";
else cout<<2<<" ";
}

return 0;}


  /*/ Author:amar1503/*/
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
#define ll long long
#define For(i,n) for(int i=0;i<n;i++)
#define bfor(i,a,b) for(int i=a;i<b;i++)
#define rfor(i,n) for(int i=n-1;i>=0;i--)
#define pb push_back
#define sz(r) r.size()
#define inf INT_MAX
#define mninf INT_MIN
#define sortv(v)  sort(v.begin(),v.end())
#define all(v) (v).begin(),(v).end()
#define Mod 1000000007
#define endl "\n"
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define d5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<endl
#define d6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<endl
#define mp make_pair
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
typedef vector<int> vi;
typedef vector< vector< int > > vvi;
typedef pair <int, int>   pii;
#define ull unsigned long long
bool comp(int a,int b){
return(a<b);
}
/*/-----------------------------Code begins----------------------------------/*/
int main(){
fio;
int n;
cin>>n;
if(n==1){
cout<<1<<endl<<1;
return 0;}
if(n==2){
cout<<1<<endl<<1<<" "<<1;
return 0;}
bool prime[n+2];
for(int i=0;i<n+2;i++)
prime[i]=1;

prime[0]=prime[1]=0;
cout<<2<<endl;
for(int i=2;i<=n+1;i++){
if(prime[i]){
for(int j=i*i;j<=n+1;j+=i)
prime[j]=0;
}
if(prime[i])
cout<<1<<" ";
else cout<<2<<" ";
}

return 0;}


#include<iostream>
using namespace std;

int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
if(n==1){
cout<<1<<endl<<1;
return 0;}
if(n==2){
cout<<1<<endl<<1<<" "<<1;
return 0;}
bool prime[n+2];
for(long long i=2;i<n+2;i++)
prime[i]=1;
cout<<2<<endl;
for(long long i=2;i<=n+1;i++){
if(prime[i]){
for(long long j=i*i;j<=n+1;j+=i)
prime[j]=0;
}
if(prime[i])
cout<<1<<" ";
else cout<<2<<" ";
}

return 0;}


  /*/ Author:amar1503/*/
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
#define ll long long
#define For(i,n) for(int i=0;i<n;i++)
#define bfor(i,a,b) for(int i=a;i<b;i++)
#define rfor(i,n) for(int i=n-1;i>=0;i--)
#define pb push_back
#define sz(r) r.size()
#define inf INT_MAX
#define mninf INT_MIN
#define sortv(v)  sort(v.begin(),v.end())
#define all(v) (v).begin(),(v).end()
#define Mod 1000000007
#define endl "\n"
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define d5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<endl
#define d6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<endl
#define mp make_pair
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
typedef vector<int> vi;
typedef vector< vector< int > > vvi;
typedef pair <int, int>   pii;
#define ull unsigned long long
bool comp(int a,int b){
return(a<b);
}
/*/-----------------------------Code begins----------------------------------/*/
int main(){
int n;
cin>>n;
bool prime[n+2];
for(int i=0;i<n+2;i++)
prime[i]=1;

prime[0]=prime[1]=0;
for(int i=2;i<=n+1;i++){
if(prime[i]){
for(ll j=i*i;j<=n+1;j+=i)
prime[j]=0;
}}

cout<<2<<endl;
for(int i=2;i<=n+1;i++){
if(prime[i])
cout<<1<<" ";
else cout<<2<<" ";}
return 0;}


#include<iostream>
using namespace std;

int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
if(n==1){
cout<<1<<endl<<1;
return 0;}
if(n==2){
cout<<1<<endl<<1<<" "<<1;
return 0;}
bool prime[n+2];
for(int i=2;i<n+2;i++)
prime[i]=1;
cout<<2<<endl;
for(int i=2;i<=n+1;i++){
if(prime[i]){
for(int j=i*i;j<=n+1;j+=i)
prime[j]=0;
}
if(prime[i])
cout<<1<<" ";
else cout<<2<<" ";
}

return 0;}


#include<bits/stdc++.h>
#define mp make_pair
#define ss second
#define ff first
#define ll long long int
#define tcase ll t;cin>>t;while(t--)
#define sz(a) int((a).size())
#define pb push_back
#define present(c,x) (�.find(x) != �.end())
#define cpresent(c,x) (find(all�,x) != �.end())
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
#define Yes cout<<"Yes\n";
#define No cout<<"No\n";
#define yes cout<<"yes\n";
#define no cout<<"no\n";
#define f(i,a) for(int i=0;i<a;i++)
#define in insert
#define matrix vector<vector<ll> >
#define e endl
const ll M=1000000000;

using namespace std;
/*
ll modexpo(ll a,ll b,ll p)
{
    ll ans=1;
      a=a%p  // update a if(a>=p)

        if(a==0)
            return 0;

                while(b!=0)
                {
                    if(b%2==1)
                        ans=(ans*a)%p;

                    a=a*a;
                    b=b/2;

                }
                return ans;
}*/
/*
ll countbit(ll n)
{
    ll c=0;
    while(n!=0)
    {
        c+=n&1;
        n>>=1;
    }
    return c;
}*/
/*ll countbit(ll n)
{
    ll c=0;
    while(n)
    {
        c+=n&1;
        n>>=1;
    }
    cout<<c<<e;
    return c;

}
  */
  vector<int> prime1;
  int prime[10000001];
  int cl[100001];
  set<int> s;
void sieve(int n)
{
       for(long long i=2;i<=n;i++)
       {
         if(prime[i]==0)
         {  prime[i]=i;
            cl[i-1]=1;
            s.in(1);
            prime1.pb(i);
         }

            for(long long j=0;j<sz(prime1) && prime1[j]<=prime[i] && i*prime1[j]<=n;j++)
            {

                   prime[i*prime1[j]]=prime1[j];
                   cl[i*prime1[j]-1]=2;
                   s.in(2);
            }

      }

 return ;
}

void fastio()
{
       ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);

}

int main()
{
    fastio();
    int n;
    cin>>n;
    if(n==1)
    {
        cout<<"1"<<e;
        cout<<"1"<<e;
        return 0;
    }
    sieve(n+1);
    cout<<sz(s)<<e;
    for(int i=1;i<=n;i++)
    cout<<cl[i]<<" ";

    return 0;
}


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

int main()
{

    int n,h=2;
    cin>>n;
    if(n==1)
        cout<<n<<"\n"<<n;
    else{
   vector<char> p(n+1,true);
   vector<int> c(n+2);
   p[0]=p[1]=false;
   for(int i=2;i*i<=n+1;i++)
   {
       if(p[i])
       {

           for(int j=i*2;j<=n+1;j+=i)
           {
               p[j]=false;
               c[j]=h;
           }
       }
   }
   for(int k=2;k<c.size();k++)
    {
        if(c[k]==0)
            c[k]=1;
    }
    cout<<"2\n";
    for(int k=2;k<c.size();k++)
    {
       cout<<c[k]<<" ";
    }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,h=2;
    cin>>n;
   vector<char> p(n+1,true);
   vector<int> c(n+2);
   p[0]=p[1]=false;
   for(int i=2;i*i<=n+1;i++)
   {
       if(p[i])
       {

           for(int j=i*i;j<=n+1;j+=i)
           {
               p[j]=false;
               c[j]=h;
           }
       }
   }
   for(int k=2;k<c.size();k++)
    {
        if(c[k]==0)
            c[k]=1;
    }
    cout<<"2\n";
    for(int k=2;k<c.size();k++)
    {
       cout<<c[k]<<" ";
    }

    return 0;
}


#include<bits/stdc++.h>
#define mp make_pair
#define ss second
#define ff first
#define ll long long int
#define tcase ll t;cin>>t;while(t--)
#define sz(a) int((a).size())
#define pb push_back
#define present(c,x) (�.find(x) != �.end())
#define cpresent(c,x) (find(all�,x) != �.end())
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
#define Yes cout<<"Yes\n";
#define No cout<<"No\n";
#define yes cout<<"yes\n";
#define no cout<<"no\n";
#define f(i,a) for(int i=0;i<a;i++)
#define in insert
#define matrix vector<vector<ll> >
#define e endl
const ll M=1000000000;

using namespace std;
/*
ll modexpo(ll a,ll b,ll p)
{
    ll ans=1;
      a=a%p  // update a if(a>=p)

        if(a==0)
            return 0;

                while(b!=0)
                {
                    if(b%2==1)
                        ans=(ans*a)%p;

                    a=a*a;
                    b=b/2;

                }
                return ans;
}*/
/*
ll countbit(ll n)
{
    ll c=0;
    while(n!=0)
    {
        c+=n&1;
        n>>=1;
    }
    return c;
}*/
/*ll countbit(ll n)
{
    ll c=0;
    while(n)
    {
        c+=n&1;
        n>>=1;
    }
    cout<<c<<e;
    return c;

}
  */
  vector<int> prime1;
  int prime[10000001];
  int cl[100001];
void sieve(int n)
{
       for(long long i=2;i<=n;i++)
       {
         if(prime[i]==0)
         {  prime[i]=i;
            cl[i-1]=1;
            prime1.pb(i);
         }

            for(long long j=0;j<sz(prime1) && prime1[j]<=prime[i] && i*prime1[j]<=n;j++)
            {

                   prime[i*prime1[j]]=prime1[j];
                   cl[i*prime1[j]-1]=2;
            }

      }

 return ;
}

void fastio()
{
       ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);

}

int main()
{
    fastio();
    int n;
    cin>>n;
    sieve(n+1);
    cout<<"2\n";
    for(int i=1;i<=n;i++)
    cout<<cl[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,h=2;
    cin>>n;
    if(n==1)
        cout<<n<<"\n"<<n;
    else{
   vector<char> p(n+1,true);
   vector<int> c(n+2);
   p[0]=p[1]=false;
   for(int i=2;i*i<=n+1;i++)
   {
       if(p[i])
       {

           for(int j=i*2;j<=n+1;j+=i)
           {
               p[j]=false;
               c[j]=h;
           }
       }
   }
   for(int k=2;k<c.size();k++)
    {
        if(c[k]==0)
            c[k]=1;
    }
    cout<<"2\n";
    for(int k=2;k<c.size();k++)
    {
       cout<<c[k]<<" ";
    }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,z=1;
    cin>>n;
   vector<char> p(n+1,true);
   vector<int> c(n+2);
   p[0]=p[1]=false;
   for(int i=2;i*i<=n+1;i++)
   {
       if(p[i])
       {
         int h=1;
           for(int j=i*i;j<=n+1;j+=i)
           {
               p[j]=false;
                    h++;
               c[j]=h;
               z++;
           }
       }
   }
   for(int k=2;k<c.size();k++)
    {
        if(c[k]==0)
            c[k]=1;
    }
    cout<<z<<"\n";
    for(int k=2;k<c.size();k++)
    {
       cout<<c[k]<<" ";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,h=2;
    cin>>n;
    if(n==1)
        cout<<n<<"\n"<<n;
    else{
   vector<char> p(n+1,true);
   vector<int> c(n+2);
   p[0]=p[1]=false;
   for(int i=2;i*i<=n+1;i++)
   {
       if(p[i])
       {

           for(int j=i*i;j<=n+1;j+=i)
           {
               p[j]=false;
               c[j]=h;
           }
       }
   }
   for(int k=2;k<c.size();k++)
    {
        if(c[k]==0)
            c[k]=1;
    }
    cout<<"2\n";
    for(int k=2;k<c.size();k++)
    {
       cout<<c[k]<<" ";
    }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a[2000000];
int main()
{
    cin>>n;
    for(int i=1; i<=n; i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    int min1=a[2]-a[1];
    int dem = 1;
    for(int i=2; i<n; i++)
    {
        if(min1 > (a[i+1]-a[i]))
        {
            min1=(a[i+1]-a[i]);
            dem=1;
        }
        else if(min1 == abs(a[i+1]-a[i]))
            dem++;
    }
    cout<<min1<<" "<<dem;
}


#include <bits/stdc++.h>
using namespace std;
int n, dem=0, a[1000000], min1=INT_MAX;
int main()
{
    cin>>n;
    for(int i=1; i<=n; i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=0; i<n-1; i++)
    {
        if(abs(a[i]-a[i+1]) < min1)
        {
            min1=abs(a[i]-a[i+1]);
            dem=1;
        }
        else if(abs(a[i]-a[i-1])==min1)
            dem++;
    }
    cout<<min1<<" "<<dem;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n, dem=1, a[1000000];
int main()
{
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    int min1 = a[2]-a[1];
    for(int i=2; i<n; i++)
    {
        if(min1 > abs(a[i+1]-a[i]))
        {
            min1=abs(a[i+1]-a[i]);
            dem=1;
        }
        else if(min1 == abs(a[i+1]-a[i]))
            dem++;
    }
    cout<<min1<<" "<<dem;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n, dem=0, a[1000000];
int main()
{
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    int min1 = a[2]-a[1];
    for(int i=2; i<n; i++)
    {
        if(abs(a[i]-a[i+1]) < min1)
        {
            min1=abs(a[i]-a[i+1]);
            dem=1;
        }
        else if(abs(a[i]-a[i+1])==min1)
            dem++;
    }
    cout<<min1<<" "<<dem;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define in  freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define fi first
#define se second
#define ll long long
#define pb push_back
#define pf push_front
using namespace std ;

const ll inf = 1e6 ;
const ll N   = 2*1e5 + 5 ;

ll n ;
ll cnt , a[N] , mn = N ;
int main ()
{

    cin >> n ;
    for ( int i = 1 ; i <= n ; i++ )
    {
        cin >> a[i] ;
    }
    sort ( a+1,a+1+n );
    for ( int i = 1 ; i < n ; i++ )
    {
        mn = min ( mn , abs(a[i]-a[i+1])) ;
    }
    for ( int i = 1 ; i < n ; i++ )
    {
       if ( abs(a[i]-a[i+1]) == mn )
       {
           cnt++ ;
       }
    }
    cout << mn << " " << cnt ;
}


#include<bits/stdc++.h>
#define ll long long
#define in  freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define fi first
#define se second
#define ll long long
#define pb push_back
#define pf push_front
using namespace std ;

const ll inf = 1e6 ;
const ll N   = 2*1e5 + 5 ;

ll n ;
ll cnt , a[N] , mn = 2e18 ;
int main ()
{

    cin >> n ;
    for ( int i = 1 ; i <= n ; i++ )
    {
        cin >> a[i] ;
    }
    sort ( a+1,a+1+n );
    for ( int i = 1 ; i <= n ; i++ )
    {
        mn = min ( mn , abs(a[i]-a[i+1])) ;
    }
    for ( int i = 1 ; i < n ; i++ )
    {
       if ( abs(a[i]-a[i+1]) == mn )
       {
           cnt++ ;
       }
    }
    cout << mn << " " << cnt ;
}


#include<bits/stdc++.h>
#define ll long long
#define in  freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define fi first
#define se second
#define ll long long
#define pb push_back
#define pf push_front
using namespace std ;

const ll inf = 1e6 ;
const ll N   = 1e5 + 5 ;

int n ;
int cnt , a[N] , mn = N ;
int main ()
{

    cin >> n ;
    for ( int i = 1 ; i <= n ; i++ )
    {
        cin >> a[i] ;
    }
    sort ( a+1,a+1+n );
    for ( int i = 1 ; i < n ; i++ )
    {
        mn = min ( mn , abs(a[i]-a[i+1])) ;
    }
    for ( int i = 1 ; i < n ; i++ )
    {
       if ( abs(a[i]-a[i+1]) == mn )
       {
           cnt++ ;
       }
    }
    cout << mn << " " << cnt ;
}


#include<bits/stdc++.h>
#define ll long long
#define in  freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define fi first
#define se second
#define ll long long
#define pb push_back
#define pf push_front
using namespace std ;

const ll inf = 1e6 ;
const ll N   = 2e5 + 5 ;

ll n ;
ll cnt , a[N] , mn = 2e18 ;
int main ()
{

    cin >> n ;
    for ( int i = 1 ; i <= n ; i++ )
    {
        cin >> a[i] ;
    }
    sort ( a+1,a+1+n );
    for ( int i = 1 ; i < n ; i++ )
    {
        mn = min ( mn , abs(a[i]-a[i+1])) ;
    }
    for ( int i = 1 ; i < n ; i++ )
    {
       if ( abs(a[i]-a[i+1]) == mn )
       {
           cnt++ ;
       }
    }
    cout << mn << " " << cnt ;
}


#include<bits/stdc++.h>
#define ll long long
#define in  freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define fi first
#define se second
#define ll long long
#define pb push_back
#define pf push_front
using namespace std ;

const ll inf = 1e6 ;
const ll N   = 2*1e5 + 5 ;

ll n ;
ll cnt , a[N] , mn = N ;
int main ()
{

    cin >> n ;
    for ( int i = 1 ; i <= n ; i++ )
    {
        cin >> a[i] ;
    }
    sort ( a+1,a+1+n );
    for ( int i = 1 ; i <= n ; i++ )
    {
        mn = min ( mn , abs(a[i]-a[i+1])) ;
    }
    for ( int i = 1 ; i < n ; i++ )
    {
       if ( abs(a[i]-a[i+1]) == mn )
       {
           cnt++ ;
       }
    }
    cout << mn << " " << cnt ;
}


#include<bits/stdc++.h>
#define ll long long
#define in  freopen("input.txt","r",stdin);
#define out freopen("output.txt","w",stdout);
#define fi first
#define se second
#define ll long long
#define pb push_back
#define pf push_front
using namespace std ;

const ll inf = 1e6 ;
const ll N   = 2e18 ;

int n ;
int cnt , a[N] , mn = N ;
int main ()
{

    cin >> n ;
    for ( int i = 1 ; i <= n ; i++ )
    {
        cin >> a[i] ;
    }
    sort ( a+1,a+1+n );
    for ( int i = 1 ; i < n ; i++ )
    {
        mn = min ( mn , abs(a[i]-a[i+1])) ;
    }
    for ( int i = 1 ; i < n ; i++ )
    {
       if ( abs(a[i]-a[i+1]) == mn )
       {
           cnt++ ;
       }
    }
    cout << mn << " " << cnt ;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    long n,min=1e10,z,k=0;
    cin>>n;
    long a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    forr(i,0,n-1){

            z=abs(a[i]-a[i+1]);
           if(z<min){
               min=z;
              k=0;
           }
           if(z==min){
            k++;
        }

    }
    cout<<min<<" "<<k;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    long n,min=100000000,z,k=0;
    cin>>n;
    long a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    forr(i,0,n){
        forr(j,i+1,n){
            z=abs(a[i]-a[j]);
           if(z<min){
               min=z;
              k=0;
           }
          if(z==min){
            k++;
           }

        }
    }
    cout<<min<<" "<<k;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    long n,min=1e10,z,k=0;
    cin>>n;
    long a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    sort(a,a+n);
    forr(i,0,n-1){

           z=abs(a[i]-a[i+1]);
           if(z<min){
               min=z;
              k=0;
           }
           if(z==min){
            k++;
        }

    }
    cout<<min<<" "<<k;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    long n,min=100000000,z,k=0;
    cin>>n;
    I a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    forr(i,0,n){
        forr(j,i+1,n){
            z=abs(a[i]-a[j]);
           if(z<min){
               min=z;
              k=0;
           }
          if(z==min){
            k++;
           }

        }
    }
    cout<<min<<" "<<k;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    long n,min=1e10,z,k=0;
    cin>>n;
    long a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    forr(i,0,n-1){
        forr(j,i+1,n){
            z=abs(a[i]-a[j]);
           if(z<min){
               min=z;
              k=0;
           }
           if(z==min){
            k++;
        }
         }

    }
    cout<<min<<" "<<k;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    I n,min=100000000,z;
    cin>>n;
    I a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    forr(i,0,n){
        forr(j,i+1,n){
            z=abs(a[i]-a[j]);
           if(z<min){
               min=z;
           }
        }
    }
    cout<<min;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    I n,min=100000000,z,k=0;
    cin>>n;
    I a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    forr(i,0,n){
        forr(j,i+1,n){
            z=abs(a[i]-a[j]);
           if(z<min){
               min=z;
              k=0;
           }
          if(z==min){
            k++;
           }

        }
    }
    cout<<min<<" "<<k;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    long n,min=100000000,z,k=0;
    cin>>n;
    long a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    sort(a,a+n);
    forr(i,0,n-1){
        forr(j,i+1,n){
            z=abs(a[i]-a[j]);
           if(z<min){
               min=z;
              k=0;
           }
          if(z==min){
            k++;
           }

        }
    }
    cout<<min<<" "<<k;
}


#include <bits/stdc++.h>

#define forr(i,a,n) for(int i=a;i<n;i++)

#define ll long long

#define I int

using namespace std;
I main(){
    long n,min=1e10,z,k=0;
    cin>>n;
    long a[n];
    forr(i,0,n){
        cin>>a[i];
    }
    sort(a,a+n)
    forr(i,0,n-1){

           z=abs(a[i]-a[i+1]);
           if(z<min){
               min=z;
              k=0;
           }
           if(z==min){
            k++;
        }

    }
    cout<<min<<" "<<k;
}


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

int main()
{
    int n,c=0,min=1e9,x;
    cin>>n;
    int a[n];
    for(x=0;x<n;x++)
    {
        cin>>a[x];

    }
    sort(a,a+n);
    for(x=1;x<n;x++)
    {
        if(a[x]-a[x-1]<min)
        {
            c=0;
            min=a[x]-a[x-1];
            c++;
        }
        else if(a[x]-a[x-1]==min)
        {
            c++;
        }
    }
    cout<<min<<" "<<c;
    return 0;
}


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

int main()
{
    int n,c=0,min=1e9,x,y;
    cin>>n;
    int a[n];
    for(x=0;x<n;x++)
    {
        cin>>a[x];

    }
    sort(a,a+n);
    for(x=1;x<n;x++)
    {
      if(abs(a[x]-a[x-1])<min)
        {
            min=abs(a[x]-a[x-1]);
        }
    }
    for(x=0;x<n-1;x++)
    {
        for(y=x+1;y<n;y++)
        {
            if(abs(a[x]-a[y])==min)
            {
                c++;
            }
        }

    }

    cout<<min<<" "<<c;
	return 0;
}


/*
  Lower bound: first element that is greater-or-equal.
  int i=lower_bound(a,a+n,x)-a;
  Upper bound: first element that is strictly greater.
  #include<boost/multiprecision/cpp_int.hpp>
  namespace mp=boost::multiprecision;
  mp::cpp_int u=1; for(unsigned i=1;i<=n;i++) u*=i;
*/
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define mem(z,i) memset(z,i,sizeof(z))
#define I (int)
const int mod=(int)1e9+7;
const long long INF = 1000000000000000000LL;
const int WASTE=(int)2e5;
int main() {
    ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
   	//#define int long long
    int n;
    cin>>n;
    int a[n];
    for(int x=0;x<n;x++)
    	cin>>a[x];
    sort(a,a+n);
    int m=mod,ans=0;
    for(int x=0;x<n-1;x++){
    	int i=abs(a[x]-a[x+1]);
    	if(i==m) ans++;
    	else if(i<m){
    		m=i; ans=1;
    	}
    }
    cout<<m<<' '<<ans;
	return 0;
}


/*
  Lower bound: first element that is greater-or-equal.
  int i=lower_bound(a,a+n,x)-a;
  Upper bound: first element that is strictly greater.
  #include<boost/multiprecision/cpp_int.hpp>
  namespace mp=boost::multiprecision;
  mp::cpp_int u=1; for(unsigned i=1;i<=n;i++) u*=i;
*/
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define mem(z,i) memset(z,i,sizeof(z))
#define I (int)
const int mod=(int)1e9+7;
const long long INF = 1000000000000000000LL;
const int WASTE=(int)2e5;
int main() {
    ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
   	//#define int long long
    int n;
    cin>>n;
    int a[n];
    for(int x=0;x<n;x++)
    	cin>>a[x];
    sort(a,a+n);
    int m=abs(a[1]-a[0]),ans=1;
    for(int x=1;x<n-1;x++){
    	int i=abs(a[x]-a[x+1]);
    	if(i==m) ans++;
    	else if(i<m){
    		m=i; ans=1;
    	}
    }
    cout<<m<<' '<<ans;
	return 0;
}


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

int main()
{
    int n,c=0,min=1e9,x;
    cin>>n;
    int a[n];
    for(x=0;x<n;x++)
    {
        cin>>a[x];

    }
    sort(a,a+n);
    for(x=1;x<n;x++)
    {
      if(abs(a[x]-a[x-1])<min)
        {
            min=abs(a[x]-a[x-1]);
        }
}

    for(x=1;x<n;x++)
    {
        if(abs(a[x]-a[x-1])==min)
        {
            c++;
        }
    }
    cout<<min<<" "<<c;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
main()
{
long long n;
int c;
cin>>n;
long long s[n];
for(int i=0;i<n;i++)
{
cin>>s[i];
}
int diff=INT_MAX;
c=0;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
   c=0;
  }
 if(abs(s[i]-s[j])==diff){
  c++;
  }
}
}
cout<<diff<<" "<<c<<endl;
return 0;
}

//IfYouDontAcceptItThisTimeIllFuckYou


#include<bits/stdc++.h>
using namespace std;
main()
{
long long s[2*100000+7],n;
long long c;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>s[i];
}
int diff=INT_MAX;
c=1;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
   c=0;
  }
 if(abs(s[i]-s[j])==diff){
  c++;
  }
}
}
cout<<diff<<" "<<c<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main()
{
long long n;
int c;
cin>>n;
long long s[n];
for(int i=0;i<n;i++)
{
cin>>s[i];
}
int diff=INT_MAX;
if(n>3){
for(int i=0;i<n-1;i++)
{
c=0;
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);

  }
  c++;
}
}
cout<<diff<<" "<<c<<endl;
}
else{
for(int i=0;i<n-1;i++)
{
c=0;
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);

  }
  c++;
}
}
cout<<diff<<" "<<c+1<<endl;

}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main()
{
int n;
int c;
int s[2*100000+2];
while(cin>>n){
for(int i=0;i<n;i++){
cin>>s[i];
}
int diff=INT_MAX;
c=0;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++){
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
   c=0;
  }
 if(abs(s[i]-s[j])==diff){
  c++;
  }
}
}
cout<<diff<<" "<<c<<endl;
}
return 0;
}

//IfYouDontAcceptItThisTimeIllFuckYou


#include<bits/stdc++.h>
using namespace std;
main()
{
long long n;
int c;
cin>>n;
long long s[n];
for(int i=0;i<n;i++)
{
cin>>s[i];
}

sort(s,s+n);
c=0;
long long diff=abs(s[0]-s[1]);
for(int i=0;i<n-1;i++){
  if(abs(s[i]-s[i+1])<diff)
  {
   diff=abs(s[i]-s[i+1]);
   c=0;
  }
 if(abs(s[i]-s[i+1])==diff){
  c++;
  }
}

cout<<diff<<" "<<c<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main()
{
long long n;
long long c;
cin>>n;
long long s[n];
for(int i=0;i<n;i++)
{
cin>>s[i];
}
long long diff=abs(s[0]-s[1]);
sort(s,s+n);
c=0;
for(int i=0;i<n-1;i++){
  if(abs(s[i]-s[i+1])<diff)
  {
   diff=abs(s[i]-s[i+1]);
   c=0;
  }
 if(abs(s[i]-s[i+1])==diff){
  c++;
  }
}

cout<<diff<<" "<<c<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main()
{
int n;
int c;
int s[n];
while(cin>>n){
for(int i=0;i<n;i++){
cin>>s[i];
}
int diff=INT_MAX;
c=0;
for(int i=0;i<=n-1;i++)
{
for(int j=i+1;j<n;j++){
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
   c=0;
  }
 if(abs(s[i]-s[j])==diff){
  c++;
  }
}
}
cout<<diff<<" "<<c<<endl;
}
return 0;
}

//IfYouDontAcceptItThisTimeIllFuckYou


#include<bits/stdc++.h>
using namespace std;
main()
{
long long n;
int c;
cin>>n;
long long s[n];
for(int i=0;i<n;i++)
{
cin>>s[i];
}
int diff=INT_MAX;
int diff1=INT_MAX;
if(n>3){
for(int i=0;i<n-1;i++)
{
c=0;
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
  }
  c++;
}
}
cout<<diff<<" "<<c<<endl;
}
else if(n<=3){
for(int i=0;i<n-1;i++)
{
c=0;
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff1=abs(s[i]-s[j]);

  }
  c++;
}
}
cout<<diff1<<" "<<c+1<<endl;
}

return 0;
}


#include<bits/stdc++.h>
using namespace std;
main()
{
long n;
int c;
int s[2*100000+7];
while(cin>>n){
for(int i=0;i<n;i++)
{
cin>>s[i];
}
int diff=INT_MAX;
c=0;
sort(s,s+n);
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
   c=0;
  }
 if(abs(s[i]-s[j])==diff){
  c++;
  }
}
}
cout<<diff<<" "<<c<<endl;
}
return 0;
}

//IfYouDontAcceptItThisTimeIllFuckYou


#include<bits/stdc++.h>
using namespace std;
main()
{
long long n;
int c;
cin>>n;
int s[2*1000000+7];
for(int i=0;i<n;i++)
{
cin>>s[i];
}
int diff=INT_MAX;
c=0;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
   c=0;
  }
 if(abs(s[i]-s[j])==diff){
  c++;
  }
}
}
cout<<diff<<" "<<c<<endl;
return 0;
}

//IfYouDontAcceptItThisTimeIllFuckYou


#include<bits/stdc++.h>
using namespace std;
main()
{
long n;
int c;
int s[2*100000+1];
while(cin>>n){
for(int i=0;i<n;i++)
{
cin>>s[i];
}
int diff=INT_MAX;
c=0;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
   c=0;
  }
 if(abs(s[i]-s[j])==diff){
  c++;
  }
}
}
cout<<diff<<" "<<c<<endl;
}
return 0;
}

//IfYouDontAcceptItThisTimeIllFuckYou


#include<bits/stdc++.h>
using namespace std;
main()
{
long long n;
long long c;
cin>>n;
long long s[n];
for(int i=0;i<n;i++)
{
cin>>s[i];
}

sort(s,s+n);
c=0;
long long diff=abs(s[0]-s[1]);
for(int i=0;i<n-1;i++){
  if(abs(s[i]-s[i+1])<diff)
  {
   diff=abs(s[i]-s[i+1]);
   c=0;
  }
 if(abs(s[i]-s[i+1])==diff){
  c++;
  }
}

cout<<diff<<" "<<c<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main()
{
long long s[2*100000+7],n;
long long c;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>s[i];
}
int diff=INT_MAX;
c=0;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
  if(abs(s[i]-s[j])<diff)
  {
   diff=abs(s[i]-s[j]);
   c=0;
  }
 if(abs(s[i]-s[j])==diff){
  c++;
  }
}
}
cout<<diff<<" "<<c<<endl;
return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

#define oo 10000000

    int n;
     int freea[200000];
    int a[20002],sopt[2000002];

    int tknp(int s)
{

    int l,r,m;
    l=0; r=n-1;
    while (l<=r)
    {
        m = (l+r)/2;
        if (a[m]==s)
        {
            //std::cout<<sopt[a[m]]<<std::endl;
            freea[m]=0;
            return 1;
        }
        if(a[m]>s) r=m-1;
        else l=m+1;
    }
    return -1;
}

using namespace std;

int main()
{

    cin>>n;
    int i;
    for (i=0;i<25000;i++) {sopt[i]=0; freea[i]=1;};
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        sopt[a[i]]++;
        //if (a[i]<0) a[i];
    //    cout<<a[i]<<endl;

    }
    sort(a,a+n);
    int luui,luuj;
    int dem=0;
    int cmin=100000;
    for (i=1;i<n;i++)
    {
        if ( abs(a[i]-a[i-1]) < cmin)
        {
            cmin=abs(a[i]-a[i-1]);
        }
    }

    for (i=0;i<n;i++)
    {   if (freea[i]){
        int x1,x2;
        x1=tknp(a[i]+cmin);
        x2=tknp(-a[i] + cmin);
        if (x1>-1) dem=dem+x1;
        if (x2>-1) dem=dem+x2;
        }
    }

    cout<<cmin<<" "<<dem<<endl;
   return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

#define oo 10000000

    int n;
    int freea[20002];
    int a[20002];

int tknp(int s)
{

    int l,r,m;
    l=0; r=n-1;
    while (l<=r)
    {
        m = (l+r)/2;
        if (a[m]==s)
        {
            freea[m]=0;
            return 1;
        }
        if(a[m]>s) r=m-1;
        else l=m+1;
    }
    return -1;
}

using namespace std;

int main()
{

    cin>>n;
    int i;

    for(i=0;i<n;i++)
    {
        cin>>a[i];
        freea[i]=1;

    }
    sort(a,a+n);

    int dem=0;
    int cmin=1000000000;
    for (i=1;i<n;i++)
    {
        if ( abs(a[i]-a[i-1]) < cmin)
        {
            cmin=abs(a[i]-a[i-1]);
        }
    }

    for (i=1;i<n;i++)
    {
        if (abs(a[i]-a[i-1])==cmin) dem++;
    }

    cout<<cmin<<" "<<dem<<endl;
   return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

#define oo 10000000

    long n;
    int freea[2000002];
    long long a[2000002];

int tknp(int s)
{

    int l,r,m;
    l=0; r=n-1;
    while (l<=r)
    {
        m = (l+r)/2;
        if (a[m]==s)
        {
            freea[m]=0;
            return 1;
        }
        if(a[m]>s) r=m-1;
        else l=m+1;
    }
    return -1;
}

using namespace std;

int main()
{

    cin>>n;
    int i;

    for(i=0;i<n;i++)
    {
        cin>>a[i];
        freea[i]=1;

    }
    sort(a,a+n);

    int dem=0;
    long long cmin=1000000000000;
    for (i=1;i<n;i++)
    {
        if ( abs(a[i]-a[i-1]) < cmin)
        {
            cmin=abs(a[i]-a[i-1]);
        }
    }

    for (i=1;i<n;i++)
    {
        if (abs(a[i]-a[i-1])==cmin) dem++;
    }

    cout<<cmin<<" "<<dem<<endl;
   return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

#define oo 10000000

    int n;
     int freea[20002];
    int a[20002];

    int tknp(int s)
{

    int l,r,m;
    l=0; r=n-1;
    while (l<=r)
    {
        m = (l+r)/2;
        if (a[m]==s)
        {
            freea[m]=0;
            return 1;
        }
        if(a[m]>s) r=m-1;
        else l=m+1;
    }
    return -1;
}

using namespace std;

int main()
{

    cin>>n;
    int i;

    for(i=0;i<n;i++)
    {
        cin>>a[i];
        freea[i]=1;

    }
    sort(a,a+n);
    int luui,luuj;
    int dem=0;
    int cmin=10000000;
    for (i=1;i<n;i++)
    {
        if ( abs(a[i]-a[i-1]) < cmin)
        {
            cmin=abs(a[i]-a[i-1]);
        }
    }

    for (i=0;i<n;i++)
    {   if (freea[i]){
        int x1,x2;
        x1=tknp(a[i]+cmin);
        x2=tknp(-a[i] + cmin);
        if (x1>-1) dem=dem+x1;
        if (x2>-1) dem=dem+x2;
        }
    }

    cout<<cmin<<" "<<dem<<endl;
   return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

#define oo 10000000
    int n;
    int a[20002],sopt[2000002];

int tknp(int s)
{

    int l,r,m;
    l=0; r=n-1;
    while (l<=r)
    {
        m = (l+r)/2;
        if (a[m]==s)
        {
            //std::cout<<sopt[a[m]]<<std::endl;
            return sopt[a[m]];
        }
        if(a[m]>s) r=m-1;
        else l=m+1;
    }
    return -1;
}
using namespace std;

int main()
{

    cin>>n;
    int i;
    for (i=0;i<25000;i++) sopt[i]=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        sopt[a[i]]++;
        //if (a[i]<0) a[i];
    //    cout<<a[i]<<endl;

    }
    sort(a,a+n);
    int luui,luuj;
    int dem=1;
    int cmin=100000;
    for (i=1;i<n;i++)
    {
        if ( abs(a[i]-a[i-1]) < cmin)
        {
            cmin=abs(a[i]-a[i-1]);
            luui=i;
            luuj=i-1;
        }
    }

    for (i=1;i<n;i++)
    {
       if (i!=luui)
            if (abs(a[i]-a[i-1])==cmin) dem++;

    }

    cout<<cmin<<" "<<dem<<endl;
   return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

#define oo 10000000

    int n;
    int freea[20002];
    long long a[20002];

int tknp(int s)
{

    int l,r,m;
    l=0; r=n-1;
    while (l<=r)
    {
        m = (l+r)/2;
        if (a[m]==s)
        {
            freea[m]=0;
            return 1;
        }
        if(a[m]>s) r=m-1;
        else l=m+1;
    }
    return -1;
}

using namespace std;

int main()
{

    cin>>n;
    int i;

    for(i=0;i<n;i++)
    {
        cin>>a[i];
        freea[i]=1;

    }
    sort(a,a+n);

    int dem=0;
    long long cmin=1000000000000;
    for (i=1;i<n;i++)
    {
        if ( abs(a[i]-a[i-1]) < cmin)
        {
            cmin=abs(a[i]-a[i-1]);
        }
    }

    for (i=1;i<n;i++)
    {
        if (abs(a[i]-a[i-1])==cmin) dem++;
    }

    cout<<cmin<<" "<<dem<<endl;
   return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

#define oo 10000000

    int n;
    int freea[20002];
    int a[20002];

int tknp(int s)
{

    int l,r,m;
    l=0; r=n-1;
    while (l<=r)
    {
        m = (l+r)/2;
        if (a[m]==s)
        {
            freea[m]=0;
            return 1;
        }
        if(a[m]>s) r=m-1;
        else l=m+1;
    }
    return -1;
}

using namespace std;

int main()
{

    cin>>n;
    int i;

    for(i=0;i<n;i++)
    {
        cin>>a[i];
        freea[i]=1;

    }
    sort(a,a+n);

    int dem=0;
    int cmin=100000;
    for (i=1;i<n;i++)
    {
        if ( abs(a[i]-a[i-1]) < cmin)
        {
            cmin=abs(a[i]-a[i-1]);
        }
    }

    for (i=1;i<n;i++)
    {
        if (abs(a[i]-a[i-1])==cmin) dem++;
    }

    cout<<cmin<<" "<<dem<<endl;
   return 0;
}


#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

#define oo 10000000

    int n;
    int freea[20002];
    int a[20002];

int tknp(int s)
{

    int l,r,m;
    l=0; r=n-1;
    while (l<=r)
    {
        m = (l+r)/2;
        if (a[m]==s)
        {
            freea[m]=0;
            return 1;
        }
        if(a[m]>s) r=m-1;
        else l=m+1;
    }
    return -1;
}

using namespace std;

int main()
{

    cin>>n;
    int i;

    for(i=0;i<n;i++)
    {
        cin>>a[i];
        freea[i]=1;

    }
    sort(a,a+n);

    int dem=0;
    long long cmin=1000000000000;
    for (i=1;i<n;i++)
    {
        if ( abs(a[i]-a[i-1]) < cmin)
        {
            cmin=abs(a[i]-a[i-1]);
        }
    }

    for (i=1;i<n;i++)
    {
        if (abs(a[i]-a[i-1])==cmin) dem++;
    }

    cout<<cmin<<" "<<dem<<endl;
   return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    vector<int> v;
     vector<int> v1;
    int n,i,mini,x,count=0,mininew;
    cin>>n;
    for(i=0;i<n;i++)
    {cin>>x;
    v.push_back(x);
    }
    sort(v.begin(),v.end());

    for(i=0;i<n-1;i++)
    {
        mini=v[i+1]-v[i];
       v1.push_back(mini);
     }
     sort(v1.begin(),v1.end());
     mininew=v1.front();
     for(i=0;i<n-1;i++)
     {if(mininew==v1[i])
     count++;}
    cout<<mininew<<" "<<count;

     return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define ll __int64
#define pb push_back
#define in(i,a) for(int i=0;i<a;++i)
#define inn(i,a,b) for(i=a;i<b;++i)
#define all(s) s.begin(),s.end()
#define mp make_pair
#define vc vector<long long>
#define vp vector<pair<ll,ll> >
const int N=1e9+5;
vc v;
int main(int argc, char const *argv[])
{
	ll n,x,mn=N,temp=0,ct=0;
	cin>>n;
	in(i,n)
	{
		cin>>x;
		v.pb(x);
	}
	sort(all(v));
	for (int i = 1; i < n; ++i)
	{
		mn=min(v[i]-v[i-1],mn);
		if(mn!=temp)
			ct=1;
		else
			ct++;
	}
	cout<<mn<<" "<<ct;
}


#include <bits/stdc++.h>
using namespace std;
#define ll __int64
#define pb push_back
#define in(i,a) for(int i=0;i<a;++i)
#define inn(i,a,b) for(i=a;i<b;++i)
#define all(s) s.begin(),s.end()
#define mp make_pair
#define vc vector<long long>
#define vp vector<pair<ll,ll> >
const int N=2*1e9+100;
vc v;
int main()
{
	ll n,x,mn=N,temp=N,ct=0;
	cin>>n;
	in(i,n)
	{
		cin>>x;
		v.pb(x);
	}
	sort(all(v));
	for (int i = 1; i < v.size(); ++i)
	{
		mn=v[i]-v[i-1];
		if(mn<temp)
			{
			    ct=1;
			    temp=mn;}
        else if(mn==temp)
			ct++;
	}
	cout<<mn<<" "<<ct;
}


#include <bits/stdc++.h>
using namespace std;
#define ll __int64
#define pb push_back
#define in(i,a) for(int i=0;i<a;++i)
#define inn(i,a,b) for(i=a;i<b;++i)
#define all(s) s.begin(),s.end()
#define mp make_pair
#define vc vector<long long>
#define vp vector<pair<ll,ll> >
const int N=1e9+5;
vc v;
int main()
{
	ll n,x,mn=N,temp=N,ct=0;
	cin>>n;
	in(i,n)
	{
		cin>>x;
		v.pb(x);
	}
	sort(all(v));
	for (int i = 1; i < v.size(); ++i)
	{
		mn=v[i]-v[i-1];
		if(mn<temp)
			{
			    ct=1;
			    temp=mn;}
        else if(mn==temp)
			ct++;
	}
	cout<<mn<<" "<<ct;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    vector<int> v;
     vector<int> v1;
    int n,i,mini,x,count=0,mininew;
    cin>>n;
    for(i=0;i<n;i++)
    {cin>>x;
    v.push_back(x);
    }
    sort(v.begin(),v.end());

    for(i=0;i<n-1;i++)
    {
        mini=v[i+1]-v[i];
       v1.push_back(mini);
     }
     sort(v1.begin(),v1.end();
     mininew=v1.front();
     for(i=0;i<n-2;i++)
     {if(mininew==v1[i])
     count++;}
    cout<<mininew<<" "<<count;

     return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define ll __int64
#define pb push_back
#define in(i,a) for( int i=0;i<a;++i)
#define inn(i,a,b) for(i=a;i<b;++i)
#define all(s) s.begin(),s.end()
#define mp make_pair
#define vc vector<long long>
#define vp vector<pair<ll,ll> >
//const int N=2*(1e9+5);
vc v;
int main()
{
	ll n,x,mn=0,temp=0,ct=0;
	cin>>n;
	in(i,n)
	{
		cin>>x;
		v.pb(x);
	}
	sort(all(v));
	mn=v[1]-v[0];
    temp=mn;
	ct++;
	//cout<<mn<<endl;
	for (int i = 2; i < v.size(); ++i)
	{
		mn=v[i]-v[i-1];

		if(mn<temp)
			{
			    ct=1;
			    temp=mn;}
        else if(mn==temp)
			ct++;
			//cout<<mn<<endl;

	}
	cout<<temp<<" "<<ct;
}


#include <bits/stdc++.h>
using namespace std;
#define ll __int64
#define pb push_back
#define in(i,a) for(int i=0;i<a;++i)
#define inn(i,a,b) for(i=a;i<b;++i)
#define all(s) s.begin(),s.end()
#define mp make_pair
#define vc vector<long long>
#define vp vector<pair<ll,ll> >
const int N=1e9+5;
vc v;
int main()
{
	ll n,x,mn=N,temp=0,ct=0;
	cin>>n;
	in(i,n)
	{
		cin>>x;
		v.pb(x);
	}
	sort(all(v));
	for (int i = 1; i < v.size(); ++i)
	{
		mn=min(v[i]-v[i-1],mn);
		if(mn!=temp)
			{
			    ct=1;
			    temp=mn;}
		else
			ct++;
	}
	cout<<mn<<" "<<ct;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    vector<int> v;
     vector<int> v1;
    int n,i,mini,x,count=0,mininew;
    cin>>n;
    for(i=0;i<n;i++)
    {cin>>x;
    v.push_back(x);
    }
    sort(v.begin(),v.end()+n);

    for(i=0;i<n-1;i++)
    {
        mini=v[i+1]-v[i];
       v1.push_back(mini);
     }
     sort(v1.begin(),v1.end()+(n-1));
     mininew=v1.front();
     for(i=0;i<n-1;i++)
     {if(mininew==v1[i])
     count++;}
    cout<<mininew<<" "<<count;

     return 0;

}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    vector<int> v;
     vector<int> v1;
    int n,i,mini,x,count=0,mininew;
    cin>>n;
    for(i=0;i<n;i++)
    {cin>>x;
    v.push_back(x);
    }
    sort(v.begin(),v.end());

    for(i=0;i<n-1;i++)
    {
        mini=v[i+1]-v[i];
       v1.push_back(mini);
     }
     sort(v1.begin(),v1.end());
     mininew=v1.front();
     for(i=0;i<n-2;i++)
     {if(mininew==v1[i])
     count++;}
    cout<<mininew<<" "<<count;

     return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define ll __int64
#define pb push_back
#define in(i,a) for(int i=0;i<a;++i)
#define inn(i,a,b) for(i=a;i<b;++i)
#define all(s) s.begin(),s.end()
#define mp make_pair
#define vc vector<long long>
#define vp vector<pair<ll,ll> >
//const int N=2*(1e9+5);
vc v;
int main()
{
	ll n,x,mn=0,temp=0,ct=0;
	cin>>n;
	in(i,n)
	{
		cin>>x;
		v.pb(x);
	}
	sort(all(v));
	mn=v[1]-v[0];
	temp=mn;
	ct++;
	for (int i = 2; i < v.size(); ++i)
	{
		mn=abs(v[i]-v[i-1]);
		if(mn<temp)
			{
			    ct=1;
			    temp=mn;}
        else if(mn==temp)
			ct++;
	}
	cout<<mn<<" "<<ct;
}


#include <bits/stdc++.h>
using namespace std;
#define ll __int64
#define pb push_back
#define in(i,a) for(int i=0;i<a;++i)
#define inn(i,a,b) for(i=a;i<b;++i)
#define all(s) s.begin(),s.end()
#define mp make_pair
#define vc vector<long long>
#define vp vector<pair<ll,ll> >
//const int N=2*(1e9+5);
vc v;
int main()
{
	ll n,x,mn=0,temp=0,ct=0;
	cin>>n;
	in(i,n)
	{
		cin>>x;
		v.pb(x);
	}
	sort(all(v));
	mn=v[1]-v[0];
	temp=mn;
	ct++;
	for (int i = 2; i < v.size(); ++i)
	{
		mn=v[i]-v[i-1];
		if(mn<temp)
			{
			    ct=1;
			    temp=mn;}
        else if(mn==temp)
			ct++;
	}
	cout<<mn<<" "<<ct;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include<queue>
#include <string>
using namespace std;
int main()
{
	int t;
	cin >> t;
	int *arr = new int[t];

	for (int  i = 0; i < t; i++)
	{
		cin >> arr[i];
	}

	int shortest = abs(arr[0] - arr[1]);
	int numc = 1;

	//sort(arr, arr + t);

	for (int i = 1; i < t-1; i++)
	{
		if (abs(arr[i] - arr[i + 1]) < shortest &&abs(arr[i] - arr[i + 1])>0)
		{
			numc = 1;
			shortest = abs(arr[i] - arr[i + 1]);

		}
		else if (abs(arr[i] - arr[i + 1]) == shortest)
		{

			numc++;
		}
	}
	if (abs(arr[0] - arr[t - 1]) < shortest)
	{
		numc = 1;
		shortest = abs(arr[0] - arr[t- 1]);
	}

	cout << shortest << " " << numc << endl;

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include<queue>
#include <string>
using namespace std;
int main()
{
	int arr[200000];
	int t;
	cin >> t;
	for (int  i = 0; i < t; i++)
	{
		cin >> arr[i];
	}

	int shortest = abs(arr[0] - arr[1]);
	int numc = 1;

	sort(arr, arr + t);
	for (int i = 1; i < t-1; i++)
	{
		if (abs(arr[i] - arr[i + 1]) < shortest)
		{
			numc = 1;
			shortest = abs(arr[i] - arr[i + 1]);

		}
		else if (abs(arr[i] - arr[i + 1]) == shortest)
		{

			numc++;
		}
	}

	cout << shortest << " " << numc << endl;

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include<queue>
#include <string>
using namespace std;
int main()
{
	int t;
	cin >> t;
	int *arr = new int[t];

	for (int  i = 0; i < t; i++)
	{
		cin >> arr[i];
	}

	int numc = 1 ;

	sort(arr, arr + t);
	int shortest = abs(arr[0] - arr[1]);

	for (int i = 1; i < t-1; i++)
	{
		if (abs(arr[i] - arr[i + 1]) < shortest )
		{
			numc = 1;
			shortest = abs(arr[i] - arr[i + 1]);

		}
		else if (abs( arr[i] - arr[i + 1]) == shortest)
		{

			numc++;

		}
	}
	/*if (abs(arr[0] - arr[t - 1]) < shortest)
	{
		numc = 1;
		shortest = abs(arr[0] - arr[t- 1]);
	}
	else if (abs(arr[0] - arr[t - 1]) == shortest)
	{

		numc++;
	}*/

	cout << shortest << " " << numc << endl;

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include<queue>
#include <string>
using namespace std;
int main()
{
	int t;
	cin >> t;
	int *arr = new int[t];

	for (int  i = 0; i < t; i++)
	{
		cin >> arr[i];
	}

	int shortest = abs(arr[0] - arr[1]);
	int numc = 1;

	sort(arr, arr + t);

	for (int i = 1; i < t-1; i++)
	{
		if (abs(arr[i] - arr[i + 1]) < shortest )
		{
			numc = 1;
			shortest = abs(arr[i] - arr[i + 1]);

		}
		else if (abs(arr[i] - arr[i + 1]) == shortest)
		{

			numc++;
		}
	}
	/*if (abs(arr[0] - arr[t - 1]) < shortest)
	{
		numc = 1;
		shortest = abs(arr[0] - arr[t- 1]);
	}*/

	cout << shortest << " " << numc << endl;

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include<queue>
#include <string>
using namespace std;
int main()
{
	int t;
	cin >> t;
	int *arr = new int[t];

	for (int  i = 0; i < t; i++)
	{
		cin >> arr[i];
	}

	int shortest = abs(arr[0] - arr[1]);
	int numc = 1;

	sort(arr, arr + t);

	for (int i = 1; i < t-1; i++)
	{
		if (abs(arr[i] - arr[i + 1]) < shortest &&abs(arr[i] - arr[i + 1])>0)
		{
			numc = 1;
			shortest = abs(arr[i] - arr[i + 1]);

		}
		else if (abs(arr[i] - arr[i + 1]) == shortest)
		{

			numc++;
		}
	}

	cout << shortest << " " << numc << endl;

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include<queue>
#include <string>
using namespace std;
int main()
{
	int arr[200000];
	int t;
	cin >> t;
	for (int  i = 0; i < t; i++)
	{
		cin >> arr[i];
	}

	int shortest = abs(arr[0] - arr[1]);
	int numc = 1;

	sort(arr, arr + t);
	int k = 0;
	while (arr[k] < 0)
	{
		arr[k] *= -1;

	}
	for (int i = 1; i < t-1; i++)
	{
		if (abs(arr[i] - arr[i + 1]) < shortest)
		{
			numc = 1;
			shortest = abs(arr[i] - arr[i + 1]);

		}
		else if (abs(arr[i] - arr[i + 1]) == shortest)
		{

			numc++;
		}
	}

	cout << shortest << " " << numc << endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    ll i,j,k=9999999999,l,n,m,f=0,p=0;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(i=1;i<n;i++)
    {
        j=abs(a[i]-a[i-1]);
        if(j<k)
        {
            k=j;
            p=1;
        }
        else if(j==k)
        {
            p++;
        }
    }
    cout<<k<<" "<<p;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long int abs(long long int a,long long int b)
{
    if(a>b)return a-b;
    else return b-a;
}
int main()
{
   long long int n;
   long long int  a[100004];

   long long int k=0;
   long long int i,count1=0;
   long long int min1=1000000008,j;
   cin>>n;
   for(i=0;i<n;i++)
   {
     cin>>a[i];
    }
    sort(a,a+n);
   for(i=0;i<n-1;i++)
   {
       min1=min(abs(a[i]-a[i+1]),min1);
   }
   for(i=0;i<n-1;i++)
   {
       if(min1==abs(a[i],a[i+1]))
       {
           count1++;
       }
   }
   cout<<min1<<" "<<count1;
 }


#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long int n;
   long long int  a[100004];
   long long int b[100005];
   long long int k=0;
   long logn int i,count1=0;
   long long int m,j;
   cin>>n;
   for(i=0;i<n;i++)
   {
     cin>>a[i];
    }
    sort(a,a+n);
   for(i=0;i<n-1;i++)
   {
       m=abs(a[i]-a[i+1]);
       b[k]=m;
       k++;
   }
   sort(b,b+k);
   for(i=0;i<k;i++)
   {
       if(b[i]==b[0])
       {
           count1++;
       }
   }
   cout<<b[0]<<" "<<count1;
 }


#include<bits/stdc++.h>
using namespace std;
long long int abs(long long int a,long long int b)
{
    if(a>b)return a-b;
    else return b-a;
}
int main()
{
   long long int n;
   long long int  a[100004];

   long long int k=0;
   long long int i,count1=0;
   long long int min1=9999999999,j;
   cin>>n;
   for(i=0;i<n;i++)
   {
     cin>>a[i];
    }
    sort(a,a+n);
   for(i=0;i<n-1;i++)
   {
       min1=min(abs(a[i]-a[i+1]),min1);
   }
   for(i=0;i<n-1;i++)
   {
       if(min1==abs(a[i],a[i+1]))
       {
           count1++;
       }
   }
   cout<<min1<<" "<<count1;
 }


#include<bits/stdc++.h>
using namespace std;
long long int abs(long long int a,long long int b)
{
    if(a>b)return a-b;
    else return b-a;
}
int main()
{
  map<long long int,long long int>m;
    long long int n,i,j,min1=10000000,g=0,l=0,o=0;
    cin>>n;
    long long int a[n];
    for(i=0;i<n;i++)
    {

        cin>>a[i];
    }
    sort(a,a+n);
    for(i=1;i<n;i++)
    {
      min1=min(abs(a[i],a[i-1]),min1);
    }
    m[min1]=1;
     for(i=1;i<n;i++)
    {

        if(m[abs(a[i],a[i-1])]==1)o++;
    }
    cout<<min1<<" "<<o;

   return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long int abs(long long int a,long long int b)
{
    if(a>b)return a-b;
    else return b-a;
}
int main()
{
  map<long long int,long long int>m;
    long long int n,i,j,min1=1000000008,g=0,l=0,o=0;
    cin>>n;
    long long int a[n];
    for(i=0;i<n;i++)
    {

        cin>>a[i];
    }
    sort(a,a+n);
    for(i=1;i<n;i++)
    {
      min1=min(abs(a[i],a[i-1]),min1);
    }
    m[min1]=1;
     for(i=1;i<n;i++)
    {

        if(m[abs(a[i],a[i-1])]==1)o++;
    }
    cout<<min1<<" "<<o;

   return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long int abs(long long int a,long long int b)
{
    if(a>b)return a-b;
    else b-a;
}
int main()
{
  map<long long int,long long int>m;
    long long int n,i,j,min1=9999999999,g=0,l=0,o=0;
    cin>>n;
    long long int a[n];
    for(i=0;i<n;i++)
    {

        cin>>a[i];
    }
    sort(a,a+n);
    for(i=1;i<n;i++)
    {
      min1=min(abs(a[i],a[i-1]),min1);
    }
    m[min1]=1;
     for(i=1;i<n;i++)
    {

        if(m[abs(a[i],a[i-1])]==1)o++;
    }
    cout<<min1<<" "<<o;

   return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long int n;
   long long int  a[100004];
   long long int b[100005];
   long long int k=0;
   long long int i,count1=0;
   long long int m,j;
   cin>>n;
   for(i=0;i<n;i++)
   {
     cin>>a[i];
    }
    sort(a,a+n);
   for(i=0;i<n-1;i++)
   {
       m=abs(a[i]-a[i+1]);
       b[k]=m;
       k++;
   }
   sort(b,b+k);
   for(i=0;i<k;i++)
   {
       if(b[i]==b[0])
       {
           count1++;
       }
   }
   cout<<b[0]<<" "<<count1;
 }


#include<bits/stdc++.h>
using namespace std;
long long int abs(long long int a,long long int b)
{
    if(a>b)return a-b;
    else b-a;
}
int main()
{
  map<long long int,long long int>m;
    long long int n,i,j,min1=10000000,g=0,l=0,o=0;
    cin>>n;
    long long int a[n];
    for(i=0;i<n;i++)
    {

        cin>>a[i];
    }
    sort(a,a+n);
    for(i=1;i<n;i++)
    {
      min1=min(abs(a[i],a[i-1]),min1);
    }
    m[min1]=1;
     for(i=1;i<n;i++)
    {

        if(m[abs(a[i],a[i-1])]==1)o++;
    }
    cout<<min1<<" "<<o;

   return 0;
}


/*
* source.cpp
*
*  Created on: Aug 4, 2016
*      Author: joseph darani
*/

#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED

#include<iostream>
#include <fstream>
#include<string.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<bitset>
#include <numeric>
//#include <intrin.h>
using namespace std;

#define iOS ios_base::sync_with_stdio(false)
#define P(x) cout<<#x<<" = { "<<x<<" }\n"
#define All(a) (a).begin(), (a).end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define lp(i,n) for(int i=0;i<int(n);i++)
#define rep(i, j, n) for (int i=j, i<n; i++)
#define lpr(i,n) for(int i=n-1;i>=0;i--)
#define loopi(i,a,n) for(int i=int(a);i<int(n);i++)
#define clr(a, n) memset(a, n, sizeof(a));
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define rdi(x) scanf("%d",&(x))
#define rdk(x,y) scanf("%d%d",&(x),&(y))
#define rdl(x) scanf("%I64d",&(x))
#define rdll(x,y) scanf("%I64d%I64d",&(x),&(y))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define Odd(x) x&1
#define Even(x) !(x&1)
#define Pi 3.1415926535897932384626433832795
#define INF 2000000000 // 2 billion
#define OO 0x7fffffff
#define maxL (10000000>>5)+1
#define GET(x) (mark[x>>5]>>(x&31)&1)
#define SET(x) (mark[x>>5] |= 1<<(x&31))
#define mod 1000000007
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;
typedef vector<vi> vvi;

//int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; // 4 Direction
//int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1};  // 8 Direction
int dx[] = { 1,-1,1,-1,2,2,-2,-2 }, dy[] = { 2,2,-2,-2,1,-1,1,-1 }; // Knight Direction
																	// int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; // Hexagonal Direction

//const int maX = 2000000000;
//binary search int

/*while(l!=r)
{
int mid=(l+r+1)/2;
if(s=="<")
r=mid-1;
else
l=mid;
}*/

//binary search double
/*double l = 0, r = 1e9 + 5;

double ans = 100000000000;
while (fabs(r-l)>0.0001)
{

double mid = (l + r) / 2.0;

int taken = ok(mid);
if (taken<=k)
{
ans = min(ans, mid/2.0);
r = mid;
}
else {
if (taken > k)
{
l = mid;
}
}
}*/

bool is_prime(long long x) {
	if (x <= 1)
		return false;
	for (int i = 2; i * i <= x; i++)
		if (x % i == 0)
			return false;
	return true;

}

bool is_palindrome(string s1) {
	int l = s1.length();
	for (int i = 0; i < l / 2; i++)
		if (s1[i] != s1[l - i - 1])
			return false;

	return true;
}

ull C(ll n, ll k) {
	if (k == 0) return 1;

	return (n * C(n - 1, k - 1)) / k;
}

ll modular_pow(ll base, ll exponent, int modulus) {
	ll result = 1;
	while (exponent > 0) {
		if (exponent % 2 == 1)
			result = (result * base) % modulus;
		exponent = exponent >> 1;
		base = (base * base) % modulus;
	}
	return result;
}

long long binaryToDec(string number) {
	long long result = 0, pow = 1;
	for (int i = number.length() - 1; i >= 0; --i, pow <<= 1)
		result = (result + (number[i] - '0') * pow) % 1000003;

	return result;
}

long long binaryToDec2(string number) {
	long long result = 0, pow = 1;
	int l = number.length();
	for (int i = 0; i <l; ++i, pow <<= 1)
		result = (result + (number[i] - '0') * pow) % 1000003;

	return result;
}

string decimalToBin(int number)
{
	if (number == 0) return "0";
	if (number == 1) return "1";

	if (number % 2 == 0)
		return decimalToBin(number / 2) + "0";
	else
		return decimalToBin(number / 2) + "1";
}
ull GCD(ull a, ull b) {
	return b == 0 ? a : GCD(b, a % b);
}

ull LCM(ull i, ull j)
{
	return (i*j) / GCD(i, j);
}

int cntMask(int mask) {
	int ret = 0;
	while (mask) {
		if (mask % 2)
			ret++;
		mask /= 2;
	}
	return ret;
}
int getBit(int mask, int i) {
	return ((mask >> i) & 1) == 1;
}
int setBit(int mask, int i, int value = 1) {
	return (value) ? mask | (1 << i) : (mask & ~(1 << i));
}

ull mystoi(string s) {
	ull ans = 0;
	ull po = 1;
	for (int i = s.length() - 1; i >= 0; i--) {
		ans += (s[i] - '0') * po;
		po *= 10;
	}

	return ans;

}

string conv(int i) {
	string t = "";
	while (i) {
		t += '0' + (i % 10);
		i /= 10;
	}
	//reverse(All(t));
	return t;
}

bool hasZero(int i) {
	if (i == 0)
		return true;
	while (i) {
		if (i % 10 == 0)
			return true;
		i /= 10;
	}
	return false;
}

bool isSortedAc(int a[], int n) {
	lp(i, n - 1)
		if (a[i] > a[i + 1])
			return false;

	return true;
}

bool isSortedDec(int a[], int n) {
	lp(i, n - 1)
		if (a[i] < a[i + 1])
			return false;

	return true;
}

bool cmp(ull i, ull j)
{
	return i>j;
}

/*
long long a[1<<18] = { 0 };
long long seg_tree[1 << 18] = { 0 };
int n, m;

void build_seg_tree(int low, int hi, int pos)
{
if (low == hi) {
seg_tree[pos] = a[low];

return;

}

int mid = (low + hi) / 2;

build_seg_tree(low, mid, 2 * pos + 1,level+1);
build_seg_tree(mid +1, hi, 2 * pos + 2,level+1);

seg_tree[pos] = max(seg_tree[2 * pos + 1] ,seg_tree[2 * pos + 2]);

return;

}

ll max_q(int low, int hi, int qlow, int qhi, int pos)
{
if (qlow > hi || qhi < low)return -1000000001;

if (low >= qlow && hi <= qhi)return seg_tree[pos];

int mid = (low + hi) / 2;
return max(max_q(low, mid, qlow, qhi, 2 * pos + 1), max_q(mid + 1, hi, qlow, qhi, 2 * pos + 2));
}

*/

ll range_sum(ll l, ll r)
{
	ll one = r*(r + 1) / 2;
	ll two = (l-1)*(l + 2) / 2;

	return one - two;
}

/*vvi adjlist;
int n, m;

bool GreySet[100000 + 5];
bool WhiteSet[100000 + 5] = { true };

bool Cycle = false;

void dfs(int u)
{
	if (GreySet[u]) { Cycle = true; return; }
	GreySet[u] = true;
	WhiteSet[u] = false;

	lp(i, adjlist[u].size())
	{
		int v = adjlist[u][i];
		dfs(v);
	}
	GreySet[u] = false;
}

vi topoSort;
bool topoVis[100000 + 5] = { false };

void topSortDfs(int u)
{
	topoVis[u] = true;

	lp(i, adjlist[u].size())
	{
		int temp = adjlist[u][i];
		if (!topoVis[temp])topSortDfs(temp);
	}
	topoSort.push_back(u);
}
*/

/*cin >> n >> m;
adjlist = vvi(n);

lp(i, m) {
int x, y;
cin >> x >> y;
x--;
y--;
adjlist[x].push_back(y);
}

lp(i, n)
{
if (WhiteSet[i])dfs(i);
if (Cycle) {
cout << "Sandro fails." << endl;
return 0;
}
}

lp(i, n)
{
if (!topoVis[i])topSortDfs(i);
}
lp(i, topoSort.size())
{
cout << topoSort[n-i-1] + 1;
if (i < topoSort.size() - 1)cout << " ";
}

cout << endl;
*/

void A()
{
	int n;
	cin >> n;

	int a[100000 + 5];
	lp(i, n)scanf("%d", &a[i]);

	sort(a, a + n);
	int ans = abs(a[0] - a[n - 1]);

	lp(i, n - 1)ans = min(ans, abs(a[i] - a[i + 1]));

	cout << ans << " ";
	int total = 0;
	lp(i, n - 1)
	{
		if (abs(a[i] - a[i + 1]) == ans)total++;
	}
	cout << total << endl;
}
int main() {

	//iOS;
	A();

	return 0;
}


/*
* source.cpp
*
*  Created on: Aug 4, 2016
*      Author: joseph darani
*/

#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATED

#include<iostream>
#include <fstream>
#include<string.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<bitset>
#include <numeric>
//#include <intrin.h>
using namespace std;

#define iOS ios_base::sync_with_stdio(false)
#define P(x) cout<<#x<<" = { "<<x<<" }\n"
#define All(a) (a).begin(), (a).end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define lp(i,n) for(int i=0;i<int(n);i++)
#define rep(i, j, n) for (int i=j, i<n; i++)
#define lpr(i,n) for(int i=n-1;i>=0;i--)
#define loopi(i,a,n) for(int i=int(a);i<int(n);i++)
#define clr(a, n) memset(a, n, sizeof(a));
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define rdi(x) scanf("%d",&(x))
#define rdk(x,y) scanf("%d%d",&(x),&(y))
#define rdl(x) scanf("%I64d",&(x))
#define rdll(x,y) scanf("%I64d%I64d",&(x),&(y))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define Odd(x) x&1
#define Even(x) !(x&1)
#define Pi 3.1415926535897932384626433832795
#define INF 2000000000 // 2 billion
#define OO 0x7fffffff
#define maxL (10000000>>5)+1
#define GET(x) (mark[x>>5]>>(x&31)&1)
#define SET(x) (mark[x>>5] |= 1<<(x&31))
#define mod 1000000007
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;
typedef vector<vi> vvi;

//int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; // 4 Direction
//int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1};  // 8 Direction
int dx[] = { 1,-1,1,-1,2,2,-2,-2 }, dy[] = { 2,2,-2,-2,1,-1,1,-1 }; // Knight Direction
																	// int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; // Hexagonal Direction

//const int maX = 2000000000;
//binary search int

/*while(l!=r)
{
int mid=(l+r+1)/2;
if(s=="<")
r=mid-1;
else
l=mid;
}*/

//binary search double
/*double l = 0, r = 1e9 + 5;

double ans = 100000000000;
while (fabs(r-l)>0.0001)
{

double mid = (l + r) / 2.0;

int taken = ok(mid);
if (taken<=k)
{
ans = min(ans, mid/2.0);
r = mid;
}
else {
if (taken > k)
{
l = mid;
}
}
}*/

bool is_prime(long long x) {
	if (x <= 1)
		return false;
	for (int i = 2; i * i <= x; i++)
		if (x % i == 0)
			return false;
	return true;

}

bool is_palindrome(string s1) {
	int l = s1.length();
	for (int i = 0; i < l / 2; i++)
		if (s1[i] != s1[l - i - 1])
			return false;

	return true;
}

ull C(ll n, ll k) {
	if (k == 0) return 1;

	return (n * C(n - 1, k - 1)) / k;
}

ll modular_pow(ll base, ll exponent, int modulus) {
	ll result = 1;
	while (exponent > 0) {
		if (exponent % 2 == 1)
			result = (result * base) % modulus;
		exponent = exponent >> 1;
		base = (base * base) % modulus;
	}
	return result;
}

long long binaryToDec(string number) {
	long long result = 0, pow = 1;
	for (int i = number.length() - 1; i >= 0; --i, pow <<= 1)
		result = (result + (number[i] - '0') * pow) % 1000003;

	return result;
}

long long binaryToDec2(string number) {
	long long result = 0, pow = 1;
	int l = number.length();
	for (int i = 0; i <l; ++i, pow <<= 1)
		result = (result + (number[i] - '0') * pow) % 1000003;

	return result;
}

string decimalToBin(int number)
{
	if (number == 0) return "0";
	if (number == 1) return "1";

	if (number % 2 == 0)
		return decimalToBin(number / 2) + "0";
	else
		return decimalToBin(number / 2) + "1";
}
ull GCD(ull a, ull b) {
	return b == 0 ? a : GCD(b, a % b);
}

ull LCM(ull i, ull j)
{
	return (i*j) / GCD(i, j);
}

int cntMask(int mask) {
	int ret = 0;
	while (mask) {
		if (mask % 2)
			ret++;
		mask /= 2;
	}
	return ret;
}
int getBit(int mask, int i) {
	return ((mask >> i) & 1) == 1;
}
int setBit(int mask, int i, int value = 1) {
	return (value) ? mask | (1 << i) : (mask & ~(1 << i));
}

ull mystoi(string s) {
	ull ans = 0;
	ull po = 1;
	for (int i = s.length() - 1; i >= 0; i--) {
		ans += (s[i] - '0') * po;
		po *= 10;
	}

	return ans;

}

string conv(int i) {
	string t = "";
	while (i) {
		t += '0' + (i % 10);
		i /= 10;
	}
	//reverse(All(t));
	return t;
}

bool hasZero(int i) {
	if (i == 0)
		return true;
	while (i) {
		if (i % 10 == 0)
			return true;
		i /= 10;
	}
	return false;
}

bool isSortedAc(int a[], int n) {
	lp(i, n - 1)
		if (a[i] > a[i + 1])
			return false;

	return true;
}

bool isSortedDec(int a[], int n) {
	lp(i, n - 1)
		if (a[i] < a[i + 1])
			return false;

	return true;
}

bool cmp(ull i, ull j)
{
	return i>j;
}

/*
long long a[1<<18] = { 0 };
long long seg_tree[1 << 18] = { 0 };
int n, m;

void build_seg_tree(int low, int hi, int pos)
{
if (low == hi) {
seg_tree[pos] = a[low];

return;

}

int mid = (low + hi) / 2;

build_seg_tree(low, mid, 2 * pos + 1,level+1);
build_seg_tree(mid +1, hi, 2 * pos + 2,level+1);

seg_tree[pos] = max(seg_tree[2 * pos + 1] ,seg_tree[2 * pos + 2]);

return;

}

ll max_q(int low, int hi, int qlow, int qhi, int pos)
{
if (qlow > hi || qhi < low)return -1000000001;

if (low >= qlow && hi <= qhi)return seg_tree[pos];

int mid = (low + hi) / 2;
return max(max_q(low, mid, qlow, qhi, 2 * pos + 1), max_q(mid + 1, hi, qlow, qhi, 2 * pos + 2));
}

*/

ll range_sum(ll l, ll r)
{
	ll one = r*(r + 1) / 2;
	ll two = (l-1)*(l + 2) / 2;

	return one - two;
}

/*vvi adjlist;
int n, m;

bool GreySet[100000 + 5];
bool WhiteSet[100000 + 5] = { true };

bool Cycle = false;

void dfs(int u)
{
	if (GreySet[u]) { Cycle = true; return; }
	GreySet[u] = true;
	WhiteSet[u] = false;

	lp(i, adjlist[u].size())
	{
		int v = adjlist[u][i];
		dfs(v);
	}
	GreySet[u] = false;
}

vi topoSort;
bool topoVis[100000 + 5] = { false };

void topSortDfs(int u)
{
	topoVis[u] = true;

	lp(i, adjlist[u].size())
	{
		int temp = adjlist[u][i];
		if (!topoVis[temp])topSortDfs(temp);
	}
	topoSort.push_back(u);
}
*/

void A()
{
	int n;
	cin >> n;

	int a[100000 + 5];
	lp(i, n)cin >> a[i];

	sort(a, a + n);
	int ans = abs(a[0] - a[n - 1]);

	lp(i, n - 1)ans = min(ans, abs(a[i] - a[i + 1]));

	cout << ans << " ";
	int total = 0;
	lp(i, n - 1)
	{
		if (abs(a[i] - a[i + 1]) == ans)total++;
	}
	cout << total << endl;
}
int main() {

	A();

	/*cin >> n >> m;
	adjlist = vvi(n);

	lp(i, m) {
		int x, y;
		cin >> x >> y;
		x--;
		y--;
		adjlist[x].push_back(y);
	}

	lp(i, n)
	{
		if (WhiteSet[i])dfs(i);
		if (Cycle) {
			cout << "Sandro fails." << endl;
			return 0;
		}
	}

	lp(i, n)
	{
		if (!topoVis[i])topSortDfs(i);
	}
	lp(i, topoSort.size())
	{
		cout << topoSort[n-i-1] + 1;
		if (i < topoSort.size() - 1)cout << " ";
	}

	cout << endl;
	*/
	return 0;
}