#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const long long LLINF = 1LL << 62;
const int mod = 1000000007;
int buffer = 1 << 13;
int cnt = buffer - 1;
char buff[10005];
char gchar()
{
if(++cnt == buffer)
{
cnt = 0;
fread(buff, buffer, 1, stdin);
}
return buff[cnt];
}
int gint()
{
int x = 0;
char c = gchar();
while(c < '0' || '9' < c)
c = gchar();
while('0' <= c && c <= '9')
{
x = x * 10 + c - '0';
c = gchar();
}
return x;
}
int n, g, i, j, k, x;
int f[205], dp[75005], lst[75005];
int main()
{
freopen("ghiozdan.in", "r", stdin);
freopen("ghiozdan.out", "w", stdout);
n = gint();
g = gint();
while(n--)
{
x = gint();
f[x]++;
}
dp[0] = 1;
for(i = 200; i >= 1; i--)
if(f[i])
for(j = g - i; j >= 0; j--)
if(dp[j] && !dp[j + i])
for(k = 1, x = j + i; k <= f[i] && x <= g; k++, x += i)
{
if(dp[x]) break;
dp[x] = dp[x - i] + 1;
lst[x] = x - i;
}
for(i = g; i >= 1; i--)
if(dp[i])
{
printf("%d %d\n", i, dp[i] - 1);
j = i;
while(j > 0)
{
printf("%d\n", j - lst[j]);
j = lst[j];
}
return 0;
}
return 0;
}