#include<iostream>
#include<cmath>
#include<bitset>
using namespace std;

int main()
{
    int n, k, b;

    cin >> n;
    cin >> k;

    int u[n];
    double p = pow( 2, (double)n );
    bitset<28> s1(0);

    for( int i = 0; i < n; i++ )
        u[i] = i;

    for( int i = 0; i < k; i++ )
    {
        cin >> b;
        for( int j = 0; j < n; j++ )
        {
            if( u[j] == b )
                s1[j] = 1;
        }
    }

    for( int i = 0; i < (int)p; i++ )
    {
        bitset<28> t(i);

        bool judge = true;
        if( ( s1 | t ) != s1 )
            judge = false;

        if( judge == true )
        {
            cout << i << ":";
            for( int j = 0; j < 28; j++ )
            {
                if( t[j] == 1 )
                    cout << " " << u[j];
            }
            cout << endl;
        }
    }
    return 0;
}

