#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int periodo, n;
while(cin >> periodo >> n) {
vector<int> a(n);
for(int i = 0; i < n; i++)
cin >> a[i];
int mx = 0, low = -1, high = -1;
for(int i = 0; i < n; i++) {
int inicio = a[i];
int fin = a[i] + periodo - 1; //2006
int aa = i, bb = n;
while(bb - aa > 1) {
int c = (aa + bb) / 2;
if(a[c] <= fin)
aa = c;
else
bb = c;
}
int cont = aa - i + 1;
if(cont > mx) {
mx = cont;
low = inicio;
high = a[aa];
}
}
cout << mx << " " << low << " " << high << "\n";
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCgppbnQgbWFpbigpewogICAgaW50IHBlcmlvZG8sIG47CiAgICB3aGlsZShjaW4gPj4gcGVyaW9kbyA+PiBuKSB7CiAgICAgICAgdmVjdG9yPGludD4gYShuKTsKICAgICAgICBmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKQogICAgICAgICAgICBjaW4gPj4gYVtpXTsKICAgICAgICBpbnQgbXggPSAwLCBsb3cgPSAtMSwgaGlnaCA9IC0xOwogICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgaW50IGluaWNpbyA9IGFbaV07CiAgICAgICAgICAgIGludCBmaW4gPSBhW2ldICsgcGVyaW9kbyAtIDE7IC8vMjAwNgogICAgICAgICAgICBpbnQgYWEgPSBpLCBiYiA9IG47CiAgICAgICAgICAgIHdoaWxlKGJiIC0gYWEgPiAxKSB7CiAgICAgICAgICAgICAgICBpbnQgYyA9IChhYSArIGJiKSAvIDI7CiAgICAgICAgICAgICAgICBpZihhW2NdIDw9IGZpbikKICAgICAgICAgICAgICAgICAgICBhYSA9IGM7CiAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgYmIgPSBjOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGludCBjb250ID0gYWEgLSBpICsgMTsgCiAgICAgICAgICAgIGlmKGNvbnQgPiBteCkgewogICAgICAgICAgICAgICAgbXggPSBjb250OwogICAgICAgICAgICAgICAgbG93ID0gaW5pY2lvOwogICAgICAgICAgICAgICAgaGlnaCA9IGFbYWFdOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGNvdXQgPDwgbXggPDwgIiAiIDw8IGxvdyA8PCAiICIgPDwgaGlnaCA8PCAiXG4iOwogICAgfQogICAgcmV0dXJuIDA7Cn0=