#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repc(i, b, e) for(auto i = (b); i != (e); i++)

int main(){
    int n, k, t;
    cin >> n;
    ll x = 0, e = pow(2, n);
    cin >> k;
    rep(i, k){
        cin >> t;
        x += (1<<t);
    }
    repc(i, 0LL, e){
        if((i & x) == i){
            bitset<30> xx(i);
            cout << i << ":";
            rep(j, n){
                if (xx.test(j)){
                    cout << " " << j;
                }
            }
        cout << endl;
        }
    }
    return 0;
}
