#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <cstdio>
#include <bitset>
#include <functional>
#include <tuple>
#include <list>
#include <deque>
using namespace std;
typedef pair<int, int> P;

#define FOR(i, a, n) for (ll i = (ll)a; i<(ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef vector<int> VI;

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    
    int n; cin >> n;
    int bit=0;
    int k; cin >> k;
    for(int i=0; i<k; ++i){
        int b; cin >> b;
        bit|=(1<<b);
    }
    vector<int> elem;
    for(int sub = bit; ; sub = (sub-1)&bit) {
        elem.push_back(sub);
        if(!sub) break;
    }
    
    sort(elem.begin(), elem.end());
    
    REP(i, elem.size()){
        cout << elem[i] << ":";
        REP(j, n) if((elem[i]>>j)&1) cout << " " << j;
        cout << endl;
    }
	return 0;
}
