#include<bits/stdc++.h>
using namespace std;
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
#define pf printf
#define prime1 1e9+7
#define prime2 1e9+9
#define scand(x) scanf("%llf",&x)
#define f(i,a,b) for(int i=a;i<=b;i++)
#define scan(a) scanf("%d",&a)
#define dbg(args) cout<<#args<<":"<<args<<endl;
#define pb(i) push_back(i)
#define ppb(x) pop_back(x)
#define maxn 100
int n,m,t,cnt;
int a[maxn],b[maxn];
void dfs(int sum,int posa,int posb)
{
if(sum>m)return;
if(sum==m)
{
cnt++;
f(i,,posb-)
{
if(i!=)
{
pf("+%d",b[i]);
}
else pf("%d",b[]);
}
pf("\n");
return;
}
f(i,posa,n)
{
b[posb]=a[i];
dfs(sum+b[posb],i+,posb+);
while(i+<=n&&a[i]==a[i+])i++;
}
return ;
}
int main()
{
std::ios::sync_with_stdio(false);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
while(scanf("%d %d",&m,&n)==&&!(n==&&m==))
{
cnt=;
memset(a,,sizeof(a));
memset(b,,sizeof(b));
f(i,,n)scan(a[i]);
sort(a+,a+n+,greater<int>());
pf("Sums of %d:\n",m);
dfs(,,);
if(!cnt)
{
pf("NONE\n");
}
}
}
05-26 07:02