#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <bitset>
#include <stdio.h>
#include <math.h>
using namespace std;
typedef std::vector<int> vi;
typedef std::vector<pair<int, int> > vii;
#define FOR(l) for(vi::iterator it=l.begin();it!=l.end();it++)
#define FOR_L(l, s, e) for(vi::iterator it=l.begin()+s;it!=l.end()-e;it++)
inline int input(){
int t=0;
char c;
c=getchar ();
while(c<'0' || c>'9')
c=getchar ();
while(c>='0' && c<='9')
{
t=(t<<3)+(t<<1)+c-'0';
c=getchar ();
}
return(t);
}
//----------Main source code -----------------//
int p[100000 +1], P;
int main() {
int y, i, first, last, mid, end, ans=0, af, al;
while(scanf("%d",&y)!=EOF){
P=input();
ans=0;
for(i=0;i<P;i++)
p[i]=input();
for(i=0;i<P;i++){
//search upper_bound by binary search
first = i+1;
last = P-1;
end = p[i]+y-1;
while(last>first){
mid = (first+last)/2;
if(p[mid]>end) last=mid;
else first = mid+1;
}
if(ans<last-i){
ans=last-i;
af=p[i];
al=p[last-1];
}
}
printf("%d %d %d\n", ans, af, al);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Yml0c2V0PgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPG1hdGguaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdHlwZWRlZiBzdGQ6OnZlY3RvcjxpbnQ+IHZpOwp0eXBlZGVmIHN0ZDo6dmVjdG9yPHBhaXI8aW50LCBpbnQ+ID4gdmlpOwojZGVmaW5lIEZPUihsKSBmb3Iodmk6Oml0ZXJhdG9yIGl0PWwuYmVnaW4oKTtpdCE9bC5lbmQoKTtpdCsrKQojZGVmaW5lIEZPUl9MKGwsIHMsIGUpIGZvcih2aTo6aXRlcmF0b3IgaXQ9bC5iZWdpbigpK3M7aXQhPWwuZW5kKCktZTtpdCsr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