#include<iostream>#include<algorithm>#include<cstring>#include<cmath>#include<vector>#include<unordered_map>usingnamespace std;typedeflonglong ll;typedef pair<int,int> pii;constint N =110;
vector<int> v[N];int a[N];bool vis[N];intmain(){int n;
cin >> n;for(int i =1; i <= n ; i ++) cin >> a[i], a[i]*=10;int finished =0, id =1;while(finished != n){for(int i =1; i <= n ; i ++){if(vis[i])continue;
v[i].push_back(id);if(finished == n -1) id +=2;else id ++;if(v[i].size()== a[i]){
finished ++;
vis[i]=1;// 该校安排完座位了}}}for(int i =1; i <= n ; i ++){
cout <<"#"<< i << endl;for(int j =0; j < v[i].size(); j ++){if(j ==0) cout << v[i][j]<<" ";else cout << v[i][j]<<" \n"[j %10==9];}}return0;}