#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n,k;
    unsigned int bitNum = 0,maxNum = 0;
    cin >> n >> k;
    vector<int> vec(k),vec2;
    for(int i = 0;i < k;++i){
        cin >> vec[i];
        maxNum |= 1 << vec[i];
    }
    
    if(vec.size() == 0){
        cout << "0:" << endl;
        return 0;
    }
   
    for(int i = 0;i < (1 << n);++i){
        if(i > maxNum){
            return 0;
        }
        for(int j = 0;j < vec.size();++j){
            int bit = 1 << vec[j];
            if(i & bit){
                bitNum |= bit;
                vec2.push_back(vec[j]);
                if(bitNum == i){
                    j = vec.size();
                }
            }
        }
        if(bitNum == i){
            cout << i << ":";
            for(int j = 0;j < vec2.size();++j){
                cout << " " << vec2[j];
            }
            cout << endl;
        }
        vec2.clear();
        bitNum = 0;
    }
}

