#include<fstream>
using namespace std;
long long n, s, a[100];
void sortare()
{
for(int i=0; i<n-1; i++)
for (int j=i+1; j<n; j++)
{
if(a[i]>a[j])
{
int aux;
aux=a[i];
a[i]=a[j];
a[j]=aux;
}
}
}
int main()
{
ifstream f("loto.in");
ofstream g("loto.out");
f>>n>>s;
for (int i=0; i<n; i++)
{
f>>a[i];
}
sortare();
if (s>6*a[n-1]) { g<<"-1"; return 0; }
long long b[6]={0, 0, 0, 0, 0, 0}, s1=s, i=0, j=n-1;
while(s1)
{
if(a[j]<=s1) { b[i]=a[j]; i++; s1-=a[j]; }
else j--;
}
//for(int i=0; i<6; i++) g<<b[i];
for(int i=5; i>=1; i--)
{
if(b[i]==0)
for(int j=i-1; j>=0; j--) if(b[j]>1) {b[j]--; b[i]++; break;}
}
for(int i=5; i>=0; i--) g<<b[i]<<" ";
return 0;
}