# 2. 题解

#include <bits/stdc++.h>
using namespace std;
template<typename _Tp>inline void IN(_Tp&dig)
{
char c;dig=0;
while(c=getchar(),!isdigit(c));
while(isdigit(c))dig=dig*10+c-'0',c=getchar();
}
struct edge{int u,v,c;}e[100000];
int k,n,cnt,T,from[2000];
vector<int> g[2000];
bool book[2000];
queue<int> que;
{
g[a].push_back(cnt),e[cnt++]=(edge){a,b,c};
g[b].push_back(cnt),e[cnt++]=(edge){b,a,0};
}
bool bfs()
{
while(!que.empty())que.pop();
memset(book,0,sizeof(book)),que.push(0),book[0]=1;
while(!que.empty())
{
int F=que.front();que.pop();
for(int i=0;i<g[F].size();i++)if(!book[e[g[F][i]].v]&&e[g[F][i]].c)
from[e[g[F][i]].v]=g[F][i],que.push(e[g[F][i]].v),book[e[g[F][i]].v]=1;
if(book[T])return 1;
}
return 0;
}
void mxf()
{
int MX=INT_MAX;
for(int i=from[T];i!=-1;i=from[e[i].u])MX=min(MX,e[i].c);
for(int i=from[T];i!=-1;i=from[e[i].u])e[i].c-=MX,e[i^1].c+=MX;
}
int main()
{
IN(k),IN(n),T=k+n+1,from[0]=-1;
for(int i=1,j,tmp;i<=n;i++)
{
IN(j);
}
while(bfs())mxf();
for(int i=1;i<=k;i++)if(book[i])puts("No Solution!"),exit(0);
for(int i=1;i<=k;i++,putchar('\n'))
{
printf("%d:",i);
for(int j=0;j<g[i].size();j++)
if(!e[g[i][j]].c&&e[g[i][j]].v)printf(" %d",e[g[i][j]].v-k);
}
return 0;
}