#include<iostream>
#include<list>
#include<string>
#include<cstring>
#include<sstream>
#include<cctype>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<stack>
#include<fstream>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
#include<queue>
#include<stdio.h>
using namespace std;
#define INF (1<<29)
#define SET(a) memset(a,-1,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define CLR(a) memset(a,0,sizeof(a))
#define FILL(a,v) memset(a,v,sizeof(a))
#define PB push_back
#define FOR(i,n) for(int i = 0;i<n;i++)
#define PI acos(-1.0)
#define EPS 1e-9
#define MP(a,b) make_pair(a,b)
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define READ freopen("input.txt", "r", stdin)
#define WRITE freopen("output.txt", "w", stdout)
#define LL long long
#define MX 100010
#define MOD 1000000007
double abss(double i)
{
return i>0 ?i:(-1.0*i);
}
int main(){
vector<int> l;
int n,s,element;
int set = 1;
while(cin>>n){
double sum = 0;
cin>>s;
FOR(i,s){
cin>>element;
sum+=element;
l.push_back(element);
}
double average = sum/n;
if((l.size()%2)!=0){
l.push_back(0);
}
sort(l.begin(),l.end());
int iter = 0;
cout<<"Set #"<<set<<endl;
double balance = 0;
FOR(i,n){
cout<<" "<<i<<": ";
if(l[iter]!=0)
cout<<l[iter]<<" ";
if(l[l.size()-iter-1]!=0)
cout<<l[l.size()-iter-1]<<endl;
balance+=abss(((l[iter])+(l[l.size()-iter-1]))-(average));
iter++;
}
printf("IMBALANCE = %0.5f\n\n",balance);
if(cin.eof()){
break;
}
set++;
l.clear();
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGxpc3Q+CiNpbmNsdWRlPHN0cmluZz4KI2luY2x1ZGU8Y3N0cmluZz4KI2luY2x1ZGU8c3N0cmVhbT4KI2luY2x1ZGU8Y2N0eXBlPgojaW5jbHVkZTxzdHJpbmcuaD4KI2luY2x1ZGU8YWxnb3JpdGhtPg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