#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl

int main(){
    ll N;
    cin >> N;

    ll k;
    cin >> k;

    vector<ll> flags;
    FOR(i, 0, k){
        ll b; cin >> b;
        flags.push_back(b);
    }

    ll L = flags.size();
    FOR(i, 0, 1LL<<L){
        ull ma = 0;
        FOR(j, 0, L){
            if(i>>j&1){
                ll bit = flags[j];
                ma |= (1LL<<bit);
            }
        }
        cout << ma << ":";
        FOR(j, 0, 28){
            if(ma>>j&1){
                cout << ' ' << j;
            }
        }
        cout << endl;
    }
    
    return 0;
}
