#include <iostream>
using namespace std;
int main ()
{
    int a,b,n,x;
    cin>>n>>x;
    int mini=x,maxi=x;
    for (int i=0;i<n;i++)
    {
        cin>>a;
        a=a-x;
        if (a<mini)
            mini=a;
        else if (a>maxi)
            maxi=a;
    }
    cout<<mini<<endl<<maxi;
    if (mini<0)
    {
        if (maxi<0)
            b=maxi+mini-mini;
        else
            b=maxi-mini-mini;
    }
    else
        b=maxi;
    cout<<b;
    return 0;
}