#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int road[2005];
int cnt[2005];

int serch(int m,int num)
{
    int val=1;
    for(int i=1 ; i<=m ; i++)
    {
        if(cnt[i]<num&&cnt[i]<cnt[val])
            val=i;
    }
    return val;
}

int main()
{
    int m,n;
    memset(road,0,sizeof(road));
    memset(cnt,0,sizeof(cnt));
    scanf("%d %d",&n,&m);
    int num=n/m;
    for(int i=0 ; i<n ; i++)
    {
        scanf("%d",&road[i]);
        if(road[i]<=m)
        {
            cnt[road[i]]++;
        }
    }
    int change=0;
    int b=serch(m,num);
    int full=0;
    if(cnt[b]>=num)
    {
        full=1;
        b=serch(m,num+1);
    }
    for(int i=0 ; i<n ; i++)
    {
        if(road[i]>m)
        {
            change++;
            road[i]=b;
            cnt[b]++;
            if(cnt[b]>=num+full)
            {
                b=serch(m,num+full);
                if(cnt[b]>=num+full)
                {
                    b=serch(m,num+1);
                    full=1;
                }
            }
        }
        else if(cnt[road[i]]>num+full)
        {
            change++;
            cnt[road[i]]--;
            road[i]=b;
            cnt[b]++;
            if(cnt[b]>=num+full)
            {
                b=serch(m,num+full);
                if(cnt[b]>=num+full)
                {
                    b=serch(m,num+1);
                    full=1;
                }
            }
        }

    }
    printf("%d %d\n",num,change);
    printf("%d",road[0]);
    for(int i=1 ; i<n ; i++)
    {
        printf(" %d",road[i]);
    }
    printf("\n");
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int road[2005];
int cnt[2005];

int serch(int m,int num)
{
    int val=1;
    for(int i=1 ; i<=m ; i++)
    {
        if(cnt[i]<num&&cnt[i]<cnt[val])
            val=i;
    }
    return val;
}

int main()
{
    int m,n;
    memset(road,0,sizeof(road));
    memset(cnt,0,sizeof(cnt));
    scanf("%d %d",&n,&m);
    int num=n/m;
    for(int i=0 ; i<n ; i++)
    {
        scanf("%d",&road[i]);
        if(road[i]<=m)
        {
            cnt[road[i]]++;
        }
    }
    int change=0;
    int save=n%m;
    int b=serch(m,num+(save>0));
    for(int i=0 ; i<n ; i++)
    {
        if(road[i]>m)
        {
            change++;
            road[i]=b;
            cnt[b]++;
            if(cnt[b]>=num+(save>0))
            {
                save--;
                b=serch(m,num+(save>0));
            }
        }
    }
    b=serch(m,num+(save>0));
    if(cnt[b]<num+(save>0))
    {
        for(int i=0 ; i<n ; i++)
        {
            if(cnt[road[i]]>num+(save>0))
            {
                cnt[road[i]]--;
                cnt[b]++;
                road[i]=b;
                change++;
                if(cnt[b]>=num+(save>0))
                {
                    b=serch(m,num+(save>0));
                }
            }
        }
    }
    /*
    b=serch(m,num);
    if(cnt[b]<num)
    {
        for(int i=0 ; i<n ; i++)
        {
            if(cnt[road[i]]>num)
            {
                cnt[road[i]]--;
                cnt[b]++;
                road[i]=b;
                change++;
                if(cnt[b]>=num)
                {
                    b=serch(m,num);
                }
            }
        }
    }
*/

    printf("%d %d\n",num,change);
    printf("%d",road[0]);
    for(int i=1 ; i<n ; i++)
    {
        printf(" %d",road[i]);
    }
    printf("\n");
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int road[2005];
int cnt[2005];

int serch(int m,int num)
{
    int val=1;
    for(int i=1 ; i<=m ; i++)
    {
        if(cnt[i]<num&&cnt[i]<cnt[val])
            val=i;
    }
    return val;
}

int main()
{
    int m,n;
    memset(road,0,sizeof(road));
    memset(cnt,0,sizeof(cnt));
    scanf("%d %d",&n,&m);
    int num=n/m;
    for(int i=0 ; i<n ; i++)
    {
        scanf("%d",&road[i]);
        if(road[i]<=m)
        {
            cnt[road[i]]++;
        }
    }
    int change=0;
    int save=n%m;
    int b=serch(m,num+(save>0));
    for(int i=0 ; i<n ; i++)
    {
        if(road[i]>m)
        {
            change++;
            road[i]=b;
            cnt[b]++;
            if(cnt[b]>=num+(save>0))
            {
                save--;
                b=serch(m,num+(save>0));
            }
        }
    }
    b=serch(m,num+(save>0));
    if(cnt[b]<num+(save>0))
    {
        for(int i=0 ; i<n ; i++)
        {
            if(cnt[road[i]]>num+(save>0))
            {
                cnt[road[i]]--;
                cnt[b]++;
                road[i]=b;
                change++;
                if(cnt[b]>=num+(save>0))
                {
                    save--;
                    b=serch(m,num+(save>0));
                }
            }
        }
    }
    /*
    b=serch(m,num);
    if(cnt[b]<num)
    {
        for(int i=0 ; i<n ; i++)
        {
            if(cnt[road[i]]>num)
            {
                cnt[road[i]]--;
                cnt[b]++;
                road[i]=b;
                change++;
                if(cnt[b]>=num)
                {
                    b=serch(m,num);
                }
            }
        }
    }
*/

    printf("%d %d\n",num,change);
    printf("%d",road[0]);
    for(int i=1 ; i<n ; i++)
    {
        printf(" %d",road[i]);
    }
    printf("\n");
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v, tmp;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
		tmp.push_back(x);
	}

	long long swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn >= a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else assert(0);
	}

	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn, idmx;
		for(long long j=1;j<=m;j++) {
			if(mnn >= a[j]) {
				mnn = a[j];
				idmn = j;
			}
			if(mx <= a[j]) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);
	long long tswp = 0;
	for(int i=0;i<v.size();i++) if(v[i] != tmp[i]) tswp++;
	assert(tm > 0);
	cout << n/m << " " << tswp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v, tmp;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
		tmp.push_back(x);
	}

	long long swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn >= a[j] && a[j] < n/m) {
				mn = a[j];
				idx = j;
			}
		}
		if(i == -1) continue;
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else assert(0);
	}

	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn, idmx;
		for(long long j=1;j<=m;j++) {
			if(mnn >= a[j]) {
				mnn = a[j];
				idmn = j;
			}
			if(mx <= a[j]) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);
	long long tswp = 0;
	for(int i=0;i<v.size();i++) if(v[i] != tmp[i]) tswp++;
	assert(tm > 0);
	cout << n/m << " " << tswp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v, tmp;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
		tmp.push_back(x);
	}

	long long swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn >= a[j] && a[j] < n/m) {
				mn = a[j];
				idx = j;
			}
		}
		if(idx == -1) continue;
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else assert(0);
	}

	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn, idmx;
		for(long long j=1;j<=m;j++) {
			if(mnn >= a[j]) {
				mnn = a[j];
				idmn = j;
			}
			if(mx <= a[j]) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);
	long long tswp = 0;
	for(int i=0;i<v.size();i++) if(v[i] != tmp[i]) tswp++;
	assert(tm > 0);
	cout << n/m << " " << tswp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v, tmp;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
		tmp.push_back(x);
	}

	long long swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn >= a[j] && a[j] < n/m) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else assert(0);
	}

	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn, idmx;
		for(long long j=1;j<=m;j++) {
			if(mnn >= a[j]) {
				mnn = a[j];
				idmn = j;
			}
			if(mx <= a[j]) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);
	long long tswp = 0;
	for(int i=0;i<v.size();i++) if(v[i] != tmp[i]) tswp++;
	assert(tm > 0);
	cout << n/m << " " << tswp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
	}

	long long work = 0, it = 0, swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn > a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
	}

	/*
	for(long long i=0;i<v.size();i++) {

		long long mn = 999999999, idx = -1;
		for(long long j=1;j<=m;j++) {
			if(mn > a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			assert(0);
		}
		else {
			if(a[v[i]] - a[idx] > 1) {
				a[idx]++;
				a[v[i]]--;
				v[i] = idx;
				swp++;
			}
		}

	}
	*/
	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn, idmx;
		for(long long j=1;j<=m;j++) {
			if(mnn > a[j]) {
				mnn = a[j];
				idmn = j;
			}
			if(mx < a[j]) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1) break;

		int reduce = mx - mnn;
		reduce /= 2;
		int sreduce = reduce;
		a[idmn] += reduce;
		a[idmx] -= reduce;
		swp += reduce;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx && sreduce) {
				sreduce--;
				v[i] = idmn;
			}
		}
	}

	long long tm = 999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);

	cout << tm << " " << swp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
	}

	long long work = 0, it = 0, swp = 0;
	for(long long i=0;i<v.size();i++) {
		if(v[i] <= m) continue;
		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn > a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else {
			if(a[v[i]] - a[idx] > 1) {
				a[idx]++;
				a[v[i]]--;
				v[i] = idx;
				swp++;
			}
		}

	}

	for(long long i=0;i<v.size();i++) {
		long long mn = 999999999, idx = -1;
		for(long long j=1;j<=m;j++) {
			if(mn > a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			assert(0);
		}
		else {
			if(a[v[i]] - a[idx] > 1) {
				a[idx]++;
				a[v[i]]--;
				v[i] = idx;
				swp++;
			}
		}

	}

	long long tm = 999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);

	cout << tm << " " << swp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v, tmp;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
		tmp.push_back(x);
	}

	long long swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn >= a[j] && a[j] < n/m) {
				mn = a[j];
				idx = j;
			}
		}
		if(idx == -1) continue;
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else assert(0);
	}

	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn = -1, idmx = -1;
		for(long long j=1;j<=m;j++) {
			if(mnn >= a[j]  && a[j] < n/m) {
				mnn = a[j];
				idmn = j;
			}
			if(mx <= a[j] && a[j] > n/m) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1 || idmn == -1 || idmx == -1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);
	long long tswp = 0;
	for(int i=0;i<v.size();i++) if(v[i] != tmp[i]) tswp++;
	assert(tm > 0);
	cout << n/m << " " << tswp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v, tmp;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
		tmp.push_back(x);
	}

	long long swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn >= a[j] && a[j] < n/m) {
				mn = a[j];
				idx = j;
			}
		}
		if(idx == -1) continue;
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else assert(0);
	}

	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn = -1, idmx = -1;
		for(long long j=1;j<=m;j++) {
			if(mnn >= a[j]  && a[j] < n/m) {
				mnn = a[j];
				idmn = j;
			}
			if(mx <= a[j] && a[j] > n/m) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1 || idmn = -1 || idmx == -1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);
	long long tswp = 0;
	for(int i=0;i<v.size();i++) if(v[i] != tmp[i]) tswp++;
	assert(tm > 0);
	cout << n/m << " " << tswp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v, tmp;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
		tmp.push_back(x);
	}

	long long swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn >= a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else assert(0);
	}

	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn, idmx;
		for(long long j=1;j<=m;j++) {
			if(mnn >= a[j]) {
				mnn = a[j];
				idmn = j;
			}
			if(mx <= a[j]) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);
	long long tswp = 0;
	for(int i=0;i<v.size();i++) if(v[i] != tmp[i]) tswp++;
	cout << tm << " " << tswp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
	}

	long long work = 0, it = 0, swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn > a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
	}

	/*
	for(long long i=0;i<v.size();i++) {

		long long mn = 999999999, idx = -1;
		for(long long j=1;j<=m;j++) {
			if(mn > a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			assert(0);
		}
		else {
			if(a[v[i]] - a[idx] > 1) {
				a[idx]++;
				a[v[i]]--;
				v[i] = idx;
				swp++;
			}
		}

	}
	*/
	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn, idmx;
		for(long long j=1;j<=m;j++) {
			if(mnn > a[j]) {
				mnn = a[j];
				idmn = j;
			}
			if(mx < a[j]) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);

	cout << tm << " " << swp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v;
	vector<pair<long long, long long> >lv(2002);
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
	}

	long long work = 0, it = 0, swp = 0;
	for(long long i=0;i<v.size();i++) {
		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn > a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		//cout << idx << " " << a[idx] << endl;
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else {
			if(a[v[i]] - a[idx] > 1) {
				a[idx]++;
				a[v[i]]--;
				v[i] = idx;
				swp++;
			}
		}
		//if(lv[it].first == work) lv[it].first++, it++;
		//if(lv[it].first != work) work++, it = 0, i--;
	}
	long long tm = 999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);

	cout << tm << " " << swp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 999999999
using namespace std;

#define speedup ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	speedup
	long long n, m;
	cin >> n >> m;
	long long a[2002] = {};
	vector<long long>v;
	for(long long i=0;i<n;i++) {
		long long x;
		cin >> x;
		if(x <= m) a[x]++;
		v.push_back(x);
	}

	long long swp = 0;
	for(long long i=0;i<v.size();i++) {

		if(v[i] <= m) continue;

		long long mn = 999999999, idx = -1;

		for(long long j=1;j<=m;j++) {
			if(mn >= a[j]) {
				mn = a[j];
				idx = j;
			}
		}
		if(v[i] > m) {
			a[idx]++;
			v[i] = idx;
			swp++;
		}
		else assert(0);
	}

	while(1) {
		long long mnn = 999999999999, mx = -1;
		int idmn, idmx;
		for(long long j=1;j<=m;j++) {
			if(mnn >= a[j]) {
				mnn = a[j];
				idmn = j;
			}
			if(mx <= a[j]) {
				mx = a[j];
				idmx = j;
			}
		}
		if(mx - mnn <= 1) break;

		a[idmn] += 1;
		a[idmx] -= 1;
		swp += 1;
		for(int i=0;i<v.size();i++) {
			if(v[i] == idmx) {
				v[i] = idmn;
				break;
			}
		}
	}

	long long tm = 999999999;

	for(long long i=1;i<=m;i++) tm = min(tm, a[i]);

	cout << tm << " " << swp << "\n";
	for(long long i=0;i<v.size();i++) cout << v[i] << " ";

}


/* AUTHORIZED BY JOKERNVT*/
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
#include <cstdio>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#define sqr(x) (x)*(x)
#define mp make_pair
#define rep(i,n) for (int i=0; i<n; i++)
#define rep1(i,n) for (int i=1; i<n; i++)
#define repi(i,l,r) for (int i=l; i<r; i++)
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<long long, long long>
#define fs first
#define sc second
#define pb push_back
using namespace std;
typedef long long ll;
const int IINF = int(1e7);
const ll LINF = ll(1e18);
const int MMAX = int(1e5+5);

int n,m,a[2005],cnt[2005],dcnt=0,ans=0,step=0;
queue<int> q,d;

int main(){
//    freopen("test.inp","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin>>n>>m;
    rep(i,n){
        cin>>a[i];
        if (a[i]<=m) cnt[a[i]]++;
    }
    ans = n/m;
    rep(i,n){
        if (a[i]>m) q.push(i);
        else{
            if (cnt[a[i]]>ans+(n%m ? 1:0)){cnt[a[i]]--; q.push(i);}
        }
    }
    repi(j,1,m+1){
        if (q.empty()) break;
        while (cnt[j]<ans && !q.empty()) {cnt[j]++; a[q.front()]=j; step++; q.pop();}
    }
    cout<<ans<<" "<<step<<endl;
    rep(i,n) cout<<a[i]<<" ";
    return 0;
}


/* AUTHORIZED BY JOKERNVT*/
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
#include <cstdio>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#define sqr(x) (x)*(x)
#define mp make_pair
#define rep(i,n) for (int i=0; i<n; i++)
#define rep1(i,n) for (int i=1; i<n; i++)
#define repi(i,l,r) for (int i=l; i<r; i++)
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<long long, long long>
#define fs first
#define sc second
#define pb push_back
using namespace std;
typedef long long ll;
const int IINF = int(1e7);
const ll LINF = ll(1e18);
const int MMAX = int(1e5+5);

int n,m,a[2005],cnt[2005],dcnt=0,ans=0,step=0;
queue<int> q,d;

int main(){
//    freopen("test.inp","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin>>n>>m;
    rep(i,n){
        cin>>a[i];
        if (a[i]<=m) cnt[a[i]]++;
    }
    ans = n/m;
    rep(i,n){
        if (a[i]>m) q.push(i);
        else{
            if (cnt[a[i]]>ans+(n%m ? 1:0)){cnt[a[i]]--; q.push(i);}
        }
    }
    repi(j,1,m+1){
        while (cnt[j]<ans) {cnt[j]++; a[q.front()]=j; step++; q.pop();}
    }
    cout<<ans<<" "<<step<<endl;
    rep(i,n) cout<<a[i]<<" ";
    return 0;
}


/* AUTHORIZED BY JOKERNVT*/
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
#include <cstdio>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#define sqr(x) (x)*(x)
#define mp make_pair
#define rep(i,n) for (int i=0; i<n; i++)
#define rep1(i,n) for (int i=1; i<n; i++)
#define repi(i,l,r) for (int i=l; i<r; i++)
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<long long, long long>
#define fs first
#define sc second
#define pb push_back
using namespace std;
typedef long long ll;
const int IINF = int(1e7);
const ll LINF = ll(1e18);
const int MMAX = int(1e5+5);

int n,m,a[2005],cnt[2005],dcnt=0,ans=0,step=0;
queue<int> q,d;

int main(){
//    freopen("test.inp","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin>>n>>m;
    rep(i,n){
        cin>>a[i];
        if (a[i]<=m) cnt[a[i]]++;
    }
    ans = n/m;
    rep(i,n){
        if (a[i]>m) q.push(i);
        else{
            if (cnt[a[i]]>ans+1){cnt[a[i]]--; q.push(i);}
        }
    }
    repi(j,1,m+1){
        if (cnt[j]<ans) {cnt[j]++; a[q.front()]=j; step++; q.pop();}
    }
    cout<<ans<<" "<<step<<endl;
    rep(i,n) cout<<a[i]<<" ";
    return 0;
}


/* AUTHORIZED BY JOKERNVT*/
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
#include <cstdio>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#define sqr(x) (x)*(x)
#define mp make_pair
#define rep(i,n) for (int i=0; i<n; i++)
#define rep1(i,n) for (int i=1; i<n; i++)
#define repi(i,l,r) for (int i=l; i<r; i++)
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<long long, long long>
#define fs first
#define sc second
#define pb push_back
using namespace std;
typedef long long ll;
const int IINF = int(1e7);
const ll LINF = ll(1e18);
const int MMAX = int(1e5+5);

int n,m,a[2005],cnt[2005],dcnt=0,ans=0,step=0;
queue<int> q,d;

int main(){
//    freopen("test.inp","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin>>n>>m;
    rep(i,n){
        cin>>a[i];
        if (a[i]<=m) cnt[a[i]]++;
    }
    ans = n/m;
    rep(i,n){
        if (a[i]>m) q.push(i);
        else{
            if (cnt[a[i]]>ans){cnt[a[i]]--; q.push(i);}
        }
    }
    repi(j,1,m+1){
        while (cnt[j]<ans) {cnt[j]++; a[q.front()]=j; step++; q.pop();}
    }
    cout<<ans<<" "<<step<<endl;
    rep(i,n) cout<<a[i]<<" ";
    return 0;
}


/* AUTHORIZED BY JOKERNVT*/
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
#include <cstdio>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#define sqr(x) (x)*(x)
#define mp make_pair
#define rep(i,n) for (int i=0; i<n; i++)
#define rep1(i,n) for (int i=1; i<n; i++)
#define repi(i,l,r) for (int i=l; i<r; i++)
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<long long, long long>
#define fs first
#define sc second
#define pb push_back
using namespace std;
typedef long long ll;
const int IINF = int(1e7);
const ll LINF = ll(1e18);
const int MMAX = int(1e5+5);

int n,m,a[2005],cnt[2005],dcnt=0,ans=0,step=0;
queue<int> q,d;

int main(){
//    freopen("test.inp","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin>>n>>m;
    rep(i,n){
        cin>>a[i];
        if (a[i]<=m) cnt[a[i]]++;
    }
    ans = n/m;
    rep(i,n){
        if (a[i]>m) q.push(i);
        else{
            if (cnt[a[i]]>ans+1){cnt[a[i]]--; q.push(i);}
        }
    }
    repi(j,1,m+1){
        while (cnt[j]<ans) {cnt[j]++; a[q.front()]=j; step++; q.pop();}
    }
    cout<<ans<<" "<<step<<endl;
    rep(i,n) cout<<a[i]<<" ";
    return 0;
}


/* AUTHORIZED BY JOKERNVT*/
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
#include <cstdio>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#define sqr(x) (x)*(x)
#define mp make_pair
#define rep(i,n) for (int i=0; i<n; i++)
#define rep1(i,n) for (int i=1; i<n; i++)
#define repi(i,l,r) for (int i=l; i<r; i++)
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<long long, long long>
#define fs first
#define sc second
#define pb push_back
using namespace std;
typedef long long ll;
const int IINF = int(1e7);
const ll LINF = ll(1e18);
const int MMAX = int(1e5+5);

int n,m,a[2005],cnt[2005],dcnt=0,ans=0,step=0;
queue<int> q,d;

int main(){
//    freopen("test.inp","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin>>n>>m;
    rep(i,n){
        cin>>a[i];
        if (a[i]<=m) cnt[a[i]]++;
    }
    ans = n/m;
    rep(i,n){
        if (a[i]>m) q.push(i);
        else{
            if (cnt[a[i]]>ans+(n%m ? 1:0)){cnt[a[i]]--; q.push(i);}
        }
    }
    repi(j,1,m+1){
        while (cnt[j]<ans) {cnt[j]++; a[q.front()]=j; step++; q.pop();}
    }
    while (!q.empty()) {a[q.front()]=1; q.pop();}
    cout<<ans<<" "<<step<<endl;
    rep(i,n) cout<<a[i]<<" ";
    return 0;
}


#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
set<PII>s,q;
int arr[MAXN],old[MAXN],ID[MAXN];
vector<int>adj[MAXN];
map<int,int>pm;
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%d",arr+i);
		old[i]=arr[i];
		pm[arr[i]]=1;
	}int c=0;
	for(int i=1;i<=m;i++)
		pm[i]=1;
	tr(it,pm){
		it->ss=++c;
		ID[c]=it->ff;
	}
	for(int i=1;i<=n;i++)
		adj[pm[arr[i]]].pb(i);
	//~ priority_queue<PII,vector<PII>,greater<PII> >q;
	for(int i=1;i<=m;i++){
		q.insert(mp(adj[i].size(),i));
		s.insert(mp(adj[i].size(),i));
	}
	for(int i=m+1;i<=c;i++){
		for(int j=0;j<int(adj[i].size());j++){
			PII st=*q.begin();
			int ind=st.ss;
			s.erase(st);
			q.erase(st);
			arr[adj[i][j]]=ind;
			adj[ind].pb(adj[i][j]);
			q.insert(mp(adj[ind].size(),ind));
			s.insert(mp(adj[ind].size(),ind));
		}
	}
	while(1){
		PII st=*q.begin();
		int ind=st.ss;
		int cnt=st.ff;
		s.erase(st);
		q.erase(st);
		if(cnt>=n/m)
			break;
		PII asd=*s.rbegin();
		s.erase(asd);
		q.erase(asd);
		arr[adj[asd.ss].back()]=ind;
		adj[ind].pb(adj[asd.ss].back());
		adj[asd.ss].ppb();
		s.insert(mp(adj[asd.ss].size(),asd.ss));
		q.insert(mp(adj[asd.ss].size(),asd.ss));
		q.insert(mp(adj[ind].size(),ind));
		s.insert(mp(adj[ind].size(),ind));
	}
	int dif=0;
	for(int i=1;i<=n;i++)
		dif+=(arr[i]!=old[i]);
	printf("%d %d\n",n/m,dif);
	for(int i=1;i<=n;i++)
		printf("%d ",arr[i]);
	printf("\n");
	return 0;
}


#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
set<PII>q;
int arr[MAXN],ans[MAXN];
vector<int>adj[MAXN];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		scanf("%d",arr+i);
	vector<int>on;
	for(int i=1;i<=n;i++){
		if(arr[i]>m)
			on.pb(i);
		else
			adj[arr[i]].pb(i);
	}
	for(int i=1;i<=m;i++)
		q.insert(mp(adj[i].size(),i));
	for(int i=0;i<int(on.size());i++){
		int to=on[i];
		PII st=*q.begin();
		int ind=st.ss;
		q.erase(st);
		adj[ind].pb(to);
		q.insert(mp(adj[ind].size(),ind));
	}
	while(1){
		PII st=*q.begin();
		int ind=st.ss;
		int cnt=st.ff;
		if(cnt>=n/m)
			break;
		PII en=*q.rbegin();
		q.erase(en);
		q.erase(st);
		adj[ind].pb(adj[en.ss].back());
		adj[en.ss].ppb();
		q.insert(mp(adj[en.ss].size(),en.ss));
		q.insert(mp(adj[ind].size(),ind));
	}
	for(int i=1;i<=m;i++)
		tr(it,adj[i])
			ans[*it]=i;
	int dif=0;
	for(int i=1;i<=n;i++)
		dif+=(ans[i]!=arr[i]);
	printf("%d %d\n",n/m,dif);
	for(int i=1;i<=n;i++)
		printf("%d ",ans[i]);
	printf("\n");
	return 0;
}


#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
set<PII>s;
int arr[MAXN],old[MAXN],ID[MAXN];
vector<int>adj[MAXN];
map<int,int>pm;
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%d",arr+i);
		old[i]=arr[i];
		pm[arr[i]]=1;
	}int c=0;
	for(int i=1;i<=m;i++)
		pm[i]=1;
	tr(it,pm){
		it->ss=++c;
		ID[c]=it->ff;
	}
	for(int i=1;i<=n;i++)
		adj[pm[arr[i]]].pb(i);
	priority_queue<PII,vector<PII>,greater<PII> >q;
	for(int i=1;i<=m;i++){
		q.push(mp(adj[i].size(),i));
		s.insert(mp(adj[i].size(),i));
	}
	for(int i=m+1;i<=c;i++){
		for(int j=0;j<int(adj[i].size());j++){
			int ind=q.top().ss;
			s.erase(q.top());
			q.pop();
			arr[adj[i][j]]=ind;
			adj[ind].pb(adj[i][j]);
			q.push(mp(adj[ind].size(),ind));
			s.insert(mp(adj[ind].size(),ind));
		}
	}
	while(1){
		int ind=q.top().ss;
		int cnt=q.top().ff;
		s.erase(q.top());
		q.pop();
		if(cnt>=n/m)
			break;
		PII asd=*s.rbegin();
		s.erase(asd);
		arr[adj[asd.ss].back()]=ind;
		adj[ind].pb(adj[asd.ss].back());
		adj[asd.ss].ppb();
		s.insert(mp(adj[asd.ss].size(),asd.ss));
		q.push(mp(adj[ind].size(),ind));
		s.insert(mp(adj[ind].size(),ind));
	}
	int dif=0;
	for(int i=1;i<=n;i++)
		dif+=(arr[i]!=old[i]);
	printf("%d %d\n",n/m,dif);
	for(int i=1;i<=n;i++)
		printf("%d ",arr[i]);
	printf("\n");
	return 0;
}


#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
set<PII>q;
int arr[MAXN],old[MAXN],ID[MAXN],ans[MAXN];
vector<int>adj[MAXN];
map<int,int>pm;
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%d",arr+i);
		old[i]=arr[i];
		pm[arr[i]]=1;
	}int c=0;
	for(int i=1;i<=m;i++)
		pm[i]=1;
	tr(it,pm){
		it->ss=++c;
		ID[c]=it->ff;
	}
	for(int i=1;i<=n;i++)
		adj[pm[arr[i]]].pb(i);
	//~ priority_queue<PII,vector<PII>,greater<PII> >q;
	for(int i=1;i<=m;i++)
		q.insert(mp(adj[i].size(),i));
	for(int i=m+1;i<=c;i++){
		for(int j=0;j<int(adj[i].size());j++){
			PII st=*q.begin();
			int ind=st.ss;
			q.erase(st);
			arr[adj[i][j]]=ind;
			adj[ind].pb(adj[i][j]);
			q.insert(mp(adj[ind].size(),ind));
		}
	}
	while(1){
		PII st=*q.begin();
		int ind=st.ss;
		int cnt=st.ff;
		if(cnt>=n/m)
			break;
		q.erase(st);
		PII asd=*q.rbegin();
		q.erase(asd);
		arr[adj[asd.ss].back()]=ind;
		adj[ind].pb(adj[asd.ss].back());
		adj[asd.ss].ppb();
		q.insert(mp(adj[asd.ss].size(),asd.ss));
		q.insert(mp(adj[ind].size(),ind));
	}
	for(int i=1;i<=m;i++)
		tr(it,adj[i])
			ans[*it]=i;
	int dif=0;
	for(int i=1;i<=n;i++)
		dif+=(ans[i]!=old[i]);
	printf("%d %d\n",n/m,dif);
	for(int i=1;i<=n;i++)
		printf("%d ",ans[i]);
	printf("\n");
	return 0;
}


#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
set<PII>q;
int arr[MAXN],ans[MAXN];
vector<int>adj[MAXN];
int n,m;
void go(){
	int dif=0;
	for(int i=1;i<=n;i++)
		dif+=(ans[i]!=arr[i]);
	printf("%d %d\n",n/m,dif);
	for(int i=1;i<=n;i++)
		printf("%d ",ans[i]);
	printf("\n");
	exit(0);
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%d",arr+i);
		ans[i]=arr[i];
	}
	vector<int>on;
	for(int i=1;i<=n;i++){
		if(arr[i]>m)
			on.pb(i);
		else
			adj[arr[i]].pb(i);
	}
	for(int i=1;i<=m;i++)
		q.insert(mp(adj[i].size(),i));
	for(int i=0;i<int(on.size());i++){
		int to=on[i];
		PII st=*q.begin();
		int ind=st.ss;
		int cnt=st.ff;
		if(cnt>=n/m)
			go();
		ans[to]=ind;
		q.erase(st);
		adj[ind].pb(to);
		q.insert(mp(adj[ind].size(),ind));
	}
	while(1){
		PII st=*q.begin();
		int ind=st.ss;
		int cnt=st.ff;
		if(cnt>=n/m)
			go();
		PII en=*q.rbegin();
		q.erase(en);
		q.erase(st);
		adj[ind].pb(adj[en.ss].back());
		ans[adj[en.ss].back()]=ind;
		adj[en.ss].ppb();
		q.insert(mp(adj[en.ss].size(),en.ss));
		q.insert(mp(adj[ind].size(),ind));
	}
	return 0;
}


#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
set<PII>q;
int arr[MAXN],ans[MAXN];
vector<int>adj[MAXN];
int n,m;
void go(){
	int dif=0;
	for(int i=1;i<=n;i++)
		dif+=(ans[i]!=arr[i]);
	printf("%d %d\n",n/m,dif);
	for(int i=1;i<=n;i++)
		printf("%d ",ans[i]);
	printf("\n");
	exit(0);
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%d",arr+i);
		ans[i]=arr[i];
	}
	vector<int>on;
	for(int i=1;i<=n;i++){
		if(arr[i]>m)
			on.pb(i);
		else
			adj[arr[i]].pb(i);
	}
	for(int i=1;i<=m;i++)
		q.insert(mp(adj[i].size(),i));
	for(int i=0;i<int(on.size());i++){
		int to=on[i];
		PII st=*q.begin();
		int ind=st.ss;
		int cnt=st.ff;
		if(cnt>=n/m)
			go();
		ans[to]=ind;
		q.erase(st);
		adj[ind].pb(to);
		q.insert(mp(adj[ind].size(),ind));
	}
	while(1){
		PII st=*q.begin();
		int ind=st.ss;
		int cnt=st.ff;
		if(cnt>=n/m)
			go();
		PII en=*q.rbegin();
		q.erase(en);
		q.erase(st);
		adj[ind].pb(adj[en.ss].back());
		adj[en.ss].ppb();
		q.insert(mp(adj[en.ss].size(),en.ss));
		q.insert(mp(adj[ind].size(),ind));
	}
	return 0;
}


#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <iostream>
#include <cstring>
#include <algorithm>

#define LL unsigned long long
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define clr(a,b) memset(a,b,sizeof a)
#define sd(x) scanf("%d",&x)
#define sf(x) scanf("%lf",&x)
#define ss(x) scanf("%s",x)
#define x first
#define y second
#define INF 0x3f3f3f3f
#define MAXN 100005
using namespace std;
vector<int> band[2016];
int a[MAXN];
int n,m;
int getMin()
{
	int num = 0;
	int mi = 1e9;
	rep(i,1,m)
	{
		if(band[i].size() <= mi)
		{
			mi = band[i].size();
			num = i;
		}
	}
	return num;
}
int getMax()
{
	int num = 0;
	int mx = 1;
	rep(i,1,m)
	{
		if(band[i].size() >= mx)
		{
			mx = band[i].size();
			num = i;

		}//cout <<band[i].size()<<" "<<mx<<endl;
	}
	return num;
}
void solve()
{
	 cin >> n >> m;
	 rep(i,1,n)
	 {
	 		scanf("%d",&a[i]);
	 		if(a[i] <= m)
	 			band[a[i]].push_back(i);
	 }
	 int mx = n/m;
	 int chang = 0;
	 rep(i,1,n)
	 {
	 		if(a[i] > m)
	 		{
	 			chang ++;
	 			a[i] = getMin();
	 			band[a[i]].push_back(i);
	 		}
	 }
	 rep(i,1,m)
	 {
	 		while(band[i].size() < mx)
	 		{
	 		    chang ++;
	 			int p = getMax();
	 			int q = band[p][0];
	 			band[p].erase(band[p].begin());
	 			a[q] = i;
	 			band[i].push_back(q);
	 		}
	 }
	 cout <<mx<<" "<<chang<<endl;
	 rep(i,1,n)
        printf("%d ",a[i]);

}
int main()
{
	  solve();
}


#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <iostream>
#include <cstring>
#include <algorithm>

#define LL unsigned long long
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define clr(a,b) memset(a,b,sizeof a)
#define sd(x) scanf("%d",&x)
#define sf(x) scanf("%lf",&x)
#define ss(x) scanf("%s",x)
#define x first
#define y second
#define INF 0x3f3f3f3f
#define MAXN 100005
using namespace std;
vector<int> band[2016];
int a[MAXN];
int n,m;
int getMin(int &mi)
{
	int num = 0;
	mi = 1e10;
	rep(i,1,m)
	{
		if(band[i].size() < mi)
		{
			mi = band[i].size();
			num = i;
		}
	}
	return num;
}
int getMax()
{
	int num = 0;
	int mx = 0;
	rep(i,1,m)
	{
		if(band[i].size() > mx)
		{
			mx = band[i].size();
			num = i;

		}//cout <<band[i].size()<<" "<<mx<<endl;
	}
	return num;
}
void solve()
{
	 int k;
	 cin >> n >> m;
	 rep(i,1,n)
	 {
	 		scanf("%d",&a[i]);
	 		if(a[i] <= m)
	 			band[a[i]].push_back(i);
	 }
	 int mx = n/m;
	 int chang = 0;
	 rep(i,1,n)
	 {
	 		if(a[i] > m)
	 		{
	 			chang ++;
	 			a[i] = getMin(k);
	 			band[a[i]].push_back(i);
	 		}
	 }
	 rep(i,1,m)
	 {
	 		if(band[i].size() < mx)
	 		{
	 		    chang ++;
	 			int p = getMax();
	 			//cout << p<< endl;
	 			int q = band[p][0];
	 			band[p].begin() = band[p].erase(band[p].begin());
	 			a[q] = i;
	 			band[i].push_back(q);

	 		}
	 }
	 cout <<mx<<" " << chang<<endl;
	 rep(i,1,n)
        printf("%d ",a[i]);

}
int main()
{
	  solve();
}


#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <iostream>
#include <cstring>
#include <algorithm>

#define LL unsigned long long
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define clr(a,b) memset(a,b,sizeof a)
#define sd(x) scanf("%d",&x)
#define sf(x) scanf("%lf",&x)
#define ss(x) scanf("%s",x)
#define x first
#define y second
#define INF 0x3f3f3f3f
#define MAXN 100005
using namespace std;
vector<int> band[2016];
int a[MAXN];
int n,m;
int getMin()
{
	int num = 0;
	int mi = 1e9;
	rep(i,1,m)
	{
		if(band[i].size() <= mi)
		{
			mi = band[i].size();
			num = i;
		}
	}
	return num;
}
int getMax()
{
	int num = 0;
	int mx = 1;
	rep(i,1,m)
	{
		if(band[i].size() >= mx)
		{
			mx = band[i].size();
			num = i;

		}//cout <<band[i].size()<<" "<<mx<<endl;
	}
	return num;
}
void solve()
{
     int k = 0;
	 cin >> n >> m;
	 rep(i,1,n)
	 {
	 		scanf("%d",&a[i]);
	 		if(a[i] <= m)
	 			band[a[i]].push_back(i),k++;
	 }
	 int mx = n/m;
	 int chang = 0;
	 rep(i,1,n)
	 {
	 		if(a[i] > m && k < mx * m)
	 		{
	 		    k++;
	 			chang ++;
	 			a[i] = getMin();
	 			band[a[i]].push_back(i);
	 		}
	 }
	 rep(i,1,m)
	 {
	 		while(band[i].size() < mx)
	 		{
	 		    chang ++;
	 			int p = getMax();
	 			int q = band[p][0];
	 			band[p].erase(band[p].begin());
	 			a[q] = i;
	 			band[i].push_back(q);
	 		}
	 }
	 cout <<mx<<" "<<chang<<endl;
	 rep(i,1,n)
        printf("%d ",a[i]);

}
int main()
{
	  solve();
}


#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <iostream>
#include <cstring>
#include <algorithm>

#define LL unsigned long long
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define clr(a,b) memset(a,b,sizeof a)
#define sd(x) scanf("%d",&x)
#define sf(x) scanf("%lf",&x)
#define ss(x) scanf("%s",x)
#define x first
#define y second
#define INF 0x3f3f3f3f
#define MAXN 100005
using namespace std;
vector<int> band[2016];
int a[MAXN];
int n,m;
int getMin(int &mi)
{
	int num = 0;
	mi = 1e9;
	rep(i,1,m)
	{
		if(band[i].size() < mi)
		{
			mi = band[i].size();
			num = i;
		}
	}
	return num;
}
int getMax()
{
	int num = 0;
	int mx = 0;
	rep(i,1,m)
	{
		if(band[i].size() > mx)
		{
			mx = band[i].size();
			num = i;

		}//cout <<band[i].size()<<" "<<mx<<endl;
	}
	return num;
}
void solve()
{
	 int k;
	 cin >> n >> m;
	 rep(i,1,n)
	 {
	 		scanf("%d",&a[i]);
	 		if(a[i] <= m)
	 			band[a[i]].push_back(i);
	 }
	 int mx = n/m;
	 int chang = 0;
	 rep(i,1,n)
	 {
	 		if(a[i] > m)
	 		{
	 			chang ++;
	 			a[i] = getMin(k);
	 			band[a[i]].push_back(i);
	 		}
	 }
	 rep(i,1,m)
	 {
	 		while(band[i].size() < mx)
	 		{
	 		    chang ++;
	 			int p = getMax();
	 			int q = band[p][0];
	 			band[p].begin() = band[p].erase(band[p].begin());
	 			a[q] = i;
	 			band[i].push_back(q);
	 		}
	 }
	 cout <<mx<<" " << chang<<endl;
	 rep(i,1,n)
        printf("%d ",a[i]);

}
int main()
{
	  solve();
}


#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <iostream>
#include <cstring>
#include <algorithm>

#define LL unsigned long long
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define clr(a,b) memset(a,b,sizeof a)
#define sd(x) scanf("%d",&x)
#define sf(x) scanf("%lf",&x)
#define ss(x) scanf("%s",x)
#define x first
#define y second
#define INF 0x3f3f3f3f
#define MAXN 100005
using namespace std;
vector<int> band[2016];
int a[MAXN];
int n,m;
int getMin()
{
	int num = 0;
	int mi = 1e9;
	rep(i,1,m)
	{
		if(band[i].size() < mi)
		{
			mi = band[i].size();
			num = i;
		}
	}
	return num;
}
int getMax()
{
	int num = 0;
	int mx = 1;
	rep(i,1,m)
	{
		if(band[i].size() > mx)
		{
			mx = band[i].size();
			num = i;

		}//cout <<band[i].size()<<" "<<mx<<endl;
	}
	return num;
}
void solve()
{
	 cin >> n >> m;
	 rep(i,1,n)
	 {
	 		scanf("%d",&a[i]);
	 		if(a[i] <= m)
	 			band[a[i]].push_back(i);
	 }
	 int mx = n/m;
	 int chang = 0;
	 rep(i,1,n)
	 {
	 		if(a[i] > m)
	 		{
	 			chang ++;
	 			a[i] = getMin();
	 			band[a[i]].push_back(i);
	 		}
	 }
	 rep(i,1,m)
	 {
	 		while(band[i].size() < mx)
	 		{
	 		    chang ++;
	 			int p = getMax();
	 			int q = band[p][0];
	 			band[p].erase(band[p].begin());
	 			a[q] = i;
	 			band[i].push_back(q);
	 		}
	 }
	 cout <<mx<<" "<<chang<<endl;
	 rep(i,1,n)
        printf("%d ",a[i]);

}
int main()
{
	  solve();
}


#include <bits/stdc++.h>
#define N 2010

using namespace std;
typedef long long ll;
ll n,m,cnt[N],a[N],numMin;

void input()
{
    cin>>n>>m;
    for(int i = 1; i <= n; ++i) {
        cin>>a[i];
        if (a[i] <= m) cnt[a[i]]++;
        else
            cnt[m+1]++;
    }
}
bool check(ll mid)
{
    ll total = 0, sum = 0;
    numMin = cnt[m+1];
    for(int i = 1; i <= m; ++i)
        if (cnt[i] > mid) total += cnt[i]-mid;
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) sum += mid - cnt[i];
    if (sum <= cnt[m+1]) {
        numMin = sum;
        return true;
    }
    else {
        if (sum <= cnt[m+1] + total) {
            numMin = sum;
            return true;
        }
        else return false;
    }
}
void trace(ll mid)
{
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) {
            for(int j = 1; j <= n; ++j)
                if (a[j] != i) {
                    if (a[j] > m && cnt[m+1] > 0 && cnt[i] < mid) {
                        a[j] = i;
                        cnt[m+1]--;
                        cnt[i]++;
                        continue;
                    }
                    if (a[j] <= m && cnt[a[j]] > mid && cnt[i] < mid) {
                        cnt[a[j]]--;
                        a[j] = i;
                        cnt[i]++;
                    }
                }
        }
    for(int i = 1; i <= n; ++i) cout<<a[i]<<" ";
}
void process()
{
    input();
    ll bot = 0, top = n+1, mid = (top + bot)/2;
    while (bot != mid && top != mid) {
        if (check(mid) == true) bot = mid; else top = mid;
        mid = (bot+top)/2;
    }
    for(int i = top; i >= bot; --i)
        if (check(i) == true) {
            cout<<i<<" "<<numMin<<endl;
            trace(i);
            return;
        }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    process();
}


#include <bits/stdc++.h>
#define N 2010

using namespace std;
typedef long long ll;
ll n,m,cnt[N],a[N],numMin;

void input()
{
    cin>>n>>m;
    for(int i = 1; i <= n; ++i) {
        cin>>a[i];
        if (a[i] <= m) cnt[a[i]]++;
        else
            cnt[m+1]++;
    }
}
bool check(ll mid)
{
    ll total = 0, sum = 0;
    numMin = cnt[m+1];
    for(int i = 1; i <= m; ++i)
        if (cnt[i] > mid) total += cnt[i]-mid;
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) sum += mid - cnt[i];
    if (sum <= cnt[m+1]) {
        numMin = cnt[m+1];
        return true;
    }
    else {
        if (sum <= cnt[m+1] + total) {
            numMin = sum;
            return true;
        }
        else return false;
    }
}
void trace(ll mid)
{
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) {
            for(int j = 1; j <= n; ++j)
                if (a[j] != i) {
                    if (a[j] > m && cnt[m+1] > 0 && cnt[i] < mid) {
                        a[j] = i;
                        cnt[m+1]--;
                        cnt[i]++;
                        continue;
                    }
                    if (a[j] <= m && cnt[a[j]] > mid && cnt[i] < mid) {
                        cnt[a[j]]--;
                        a[j] = i;
                        cnt[i]++;
                    }
                }
        }
    for(int i = 1; i <= n; ++i) cout<<a[i]<<" ";
}
void process()
{
    input();
    ll bot = 0, top = n+1, mid = (top + bot)/2;
    while (bot != mid && top != mid) {
        if (check(mid) == true) bot = mid; else top = mid;
        mid = (bot+top)/2;
    }
    for(int i = top; i >= bot; --i)
        if (check(i) == true) {
            cout<<i<<" "<<numMin<<endl;
            trace(i);
            return;
        }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    process();
}


#include <bits/stdc++.h>
#define N 2010

using namespace std;
typedef long long ll;
ll n,m,cnt[N],a[N],numMin;

void input()
{
    cin>>n>>m;
    for(int i = 1; i <= n; ++i) {
        cin>>a[i];
        if (a[i] <= m) cnt[a[i]]++;
        else
            cnt[m+1]++;
    }
}
bool check(ll mid)
{
    ll total = 0, sum = 0;
    numMin = cnt[m+1];
    for(int i = 1; i <= m; ++i)
        if (cnt[i] > mid) total += cnt[i]-mid;
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) sum += mid - cnt[i];
    if (sum <= cnt[m+1]) {
        numMin = cnt[m+1];
        return true;
    }
    else {
        if (sum <= cnt[m+1] + total) {
            numMin = sum;
            return true;
        }
        else return false;
    }
}
void trace(ll mid)
{
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid)
            for(int j = 1; j <= n; ++j) {
                if (a[j] > m && cnt[m+1] > 0 && cnt[i] < mid) {
                    a[j] = i;
                    cnt[m+1]--;
                    cnt[i]++;
                }
                if (a[j] <= m && cnt[a[j]] > m && cnt[i] < mid) {
                    a[j] = i;
                    cnt[a[j]] = i;
                    cnt[i]++;
                }
            }
    for(int i = 1; i <= n; ++i) cout<<a[i]<<" ";
}
void process()
{
    input();
    ll bot = 0, top = n+1, mid = (top + bot)/2;
    while (bot != mid && top != mid) {
        if (check(mid) == true) bot = mid; else top = mid;
        mid = (bot+top)/2;
    }
    for(int i = top; i >= bot; --i)
        if (check(i) == true) {
            cout<<i<<" "<<numMin<<endl;
            trace(i);
            return;
        }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    process();
}


#include <bits/stdc++.h>
#define N 2010

using namespace std;
typedef long long ll;
ll n,m,cnt[N],a[N],numMin;

void input()
{
    cin>>n>>m;
    for(int i = 1; i <= n; ++i) {
        cin>>a[i];
        if (a[i] <= m) cnt[a[i]]++;
        else
            cnt[m+1]++;
    }
}
bool check(ll mid)
{
    ll total = 0, sum = 0;
    numMin = cnt[m+1];
    for(int i = 1; i <= m; ++i)
        if (cnt[i] > mid) total += cnt[i]-mid;
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) sum += mid - cnt[i];
    if (sum <= cnt[m+1]) {
        numMin = cnt[m+1];
        return true;
    }
    else {
        if (sum <= cnt[m+1] + total) {
            numMin = sum;
            return true;
        }
        else return false;
    }
}
void trace(ll mid)
{
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) {
            for(int j = 1; j <= n; ++j)
                if (a[j] != i){
                    if (a[j] > m && cnt[m+1] > 0 && cnt[i] < mid) {
                        a[j] = i;
                        cnt[m+1]--;
                        cnt[i]++;
                        continue;
                    }
                    if (a[j] <= m && cnt[a[j]] > mid && cnt[i] < mid) {
                        cnt[a[j]]--;
                        a[j] = i;
                        cnt[i]++;
                    }
                }
        }
    for(int i = 1; i <= n; ++i) cout<<a[i]<<" ";
}
void process()
{
    input();
    ll bot = 0, top = n+1, mid = (top + bot)/2;
    while (bot != mid && top != mid) {
        if (check(mid) == true) bot = mid; else top = mid;
        mid = (bot+top)/2;
    }
    for(int i = top; i >= bot; --i)
        if (check(i) == true) {
            cout<<i<<" "<<numMin<<endl;
            trace(i);
            return;
        }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    process();
}


#include <bits/stdc++.h>
#define N 2010

using namespace std;
typedef long long ll;
ll n,m,cnt[N],a[N],numMin;

void input()
{
    cin>>n>>m;
    for(int i = 1; i <= n; ++i) {
        cin>>a[i];
        if (a[i] <= m) cnt[a[i]]++;
        else
            cnt[m+1]++;
    }
}
bool check(ll mid)
{
    ll total = 0, sum = 0;
    numMin = cnt[m+1];
    for(int i = 1; i <= m; ++i)
        if (cnt[i] > mid) total += cnt[i]-mid;
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) sum += mid - cnt[i];
    if (sum <= cnt[m+1]) {
        numMin = cnt[m+1];
        return true;
    }
    else {
        if (sum <= cnt[m+1] + total) {
            numMin = sum;
            return true;
        }
        else return false;
    }
}
void trace(ll mid)
{
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) {
            for(int j = 1; j <= n; ++j)
                if (a[j] != i) {
                    if (a[j] > m && cnt[m+1] > 0 && cnt[i] < mid) {
                        a[j] = i;
                        cnt[m+1]--;
                        cnt[i]++;
                        continue;
                    }
                    if (a[j] <= m && cnt[a[j]] > mid && cnt[i] < mid) {
                        cnt[a[j]]--;
                        a[j] = i;
                        cnt[i]++;
                    }
                }
        }
    for(int i = 1; i <= n; ++i)
        if (a[j] > m) a[j] = m;
    for(int i = 1; i <= n; ++i) cout<<a[i]<<" ";
}
void process()
{
    input();
    ll bot = 0, top = n+1, mid = (top + bot)/2;
    while (bot != mid && top != mid) {
        if (check(mid) == true) bot = mid; else top = mid;
        mid = (bot+top)/2;
    }
    for(int i = top; i >= bot; --i)
        if (check(i) == true) {
            cout<<i<<" "<<numMin<<endl;
            trace(i);
            return;
        }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    process();
}


#include <bits/stdc++.h>
#define N 2010

using namespace std;
typedef long long ll;
ll n,m,cnt[N],a[N],numMin;

void input()
{
    cin>>n>>m;
    for(int i = 1; i <= n; ++i) {
        cin>>a[i];
        if (a[i] <= m) cnt[a[i]]++;
        else
            cnt[m+1]++;
    }
}
bool check(ll mid)
{
    ll total = 0, sum = 0;
    numMin = cnt[m+1];
    for(int i = 1; i <= m; ++i)
        if (cnt[i] > mid) total += cnt[i]-mid;
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) sum += mid - cnt[i];
    if (sum <= cnt[m+1]) {
        numMin = cnt[m+1];
        return true;
    }
    else {
        if (sum <= cnt[m+1] + total) {
            numMin = sum;
            return true;
        }
        else return false;
    }
}
void trace(ll mid)
{
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid)
            for(int j = 1; j <= n; ++j) {
                if (a[j] > m && cnt[m+1] > 0 && cnt[i] < mid) {
                    a[j] = i;
                    cnt[m+1]--;
                    cnt[i]++;
                }
                if (a[j] <= m && cnt[a[j]] > m && cnt[i] < mid) {
                    a[j] = i;
                    cnt[a[j]]--;
                    cnt[i]++;
                }
            }
    for(int i = 1; i <= n; ++i) cout<<a[i]<<" ";
}
void process()
{
    input();
    ll bot = 0, top = n+1, mid = (top + bot)/2;
    while (bot != mid && top != mid) {
        if (check(mid) == true) bot = mid; else top = mid;
        mid = (bot+top)/2;
    }
    for(int i = top; i >= bot; --i)
        if (check(i) == true) {
            cout<<i<<" "<<numMin<<endl;
            trace(i);
            return;
        }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    process();
}


#include <bits/stdc++.h>
#define N 2010

using namespace std;
typedef long long ll;
ll n,m,cnt[N],a[N],numMin;

void input()
{
    cin>>n>>m;
    for(int i = 1; i <= n; ++i) {
        cin>>a[i];
        if (a[i] <= m) cnt[a[i]]++;
        else
            cnt[m+1]++;
    }
}
bool check(ll mid)
{
    ll total = 0, sum = 0;
    numMin = cnt[m+1];
    for(int i = 1; i <= m; ++i)
        if (cnt[i] > mid) total += cnt[i]-mid;
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) sum += mid - cnt[i];
    if (sum <= cnt[m+1]) {
        numMin = cnt[m+1];
        return true;
    }
    else {
        if (sum <= cnt[m+1] + total) {
            numMin = sum;
            return true;
        }
        else return false;
    }
}
void trace(ll mid)
{
    for(int i = 1; i <= m; ++i)
        if (cnt[i] < mid) {
            for(int j = 1; j <= n; ++j)
                if (a[j] != i) {
                    if (a[j] > m && cnt[m+1] > 0 && cnt[i] < mid) {
                        a[j] = i;
                        cnt[m+1]--;
                        cnt[i]++;
                        continue;
                    }
                    if (a[j] <= m && cnt[a[j]] > mid && cnt[i] < mid) {
                        cnt[a[j]]--;
                        a[j] = i;
                        cnt[i]++;
                    }
                }
        }
    for(int i = 1; i <= n; ++i)
        if (a[i] > m) a[i] = m;
    for(int i = 1; i <= n; ++i) cout<<a[i]<<" ";
}
void process()
{
    input();
    ll bot = 0, top = n+1, mid = (top + bot)/2;
    while (bot != mid && top != mid) {
        if (check(mid) == true) bot = mid; else top = mid;
        mid = (bot+top)/2;
    }
    for(int i = top; i >= bot; --i)
        if (check(i) == true) {
            cout<<i<<" "<<numMin<<endl;
            trace(i);
            return;
        }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    process();
}


#include <iostream>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

typedef pair<int, int> key;

set<key> s;
map<key,int> M;
map<int,int> ans;

int num[2010], tmp[2010];

int mark[2010] = {0};

int main()
{
    int n, m;

    scanf("%d %d", &n, &m);
    for(int i = 1;i <= m; ++i)
    {
        ans[i] = 0;
        M[make_pair(0, i)] = 0;
    }

    for(int i = 1;i <= n; ++i)
    {
        scanf("%d", &num[i]);

    }

    int old = n;

    while(n%m) num[++n] = 1000000000;

    for(int i = 1;i <= n; ++i)
    {
        tmp[i] = num[i];
        if(num[i] <= m)
        {
            key K = make_pair(ans[num[i]], num[i]);
            int V = M[K];
            ans[num[i]]++;
            M.erase(K);
            K.first++;
            V++;
            M[K] = V;
        }
    }

    for(int i = 1;i <= n; ++i)
    {
        if(num[i] > m)
        {
            key K = M.begin()->first;
            int V = M.begin()->second;
            num[i] = K.second;
            ans[K.second]++;
            M.erase(K);
            K.first++;
            V++;
            M[K] = V;
        }
    }

    int avg = n/m;

    for(int i = 1;i <= n; ++i)
    {
        if(ans[num[i]] > avg && num[i] != tmp[i])
        {
            key K = M.find(make_pair(ans[num[i]], num[i]))->first;
            int V = M.find(make_pair(ans[num[i]], num[i]))->second;

            M.erase(K);
            ans[num[i]]--;

            M[make_pair(ans[num[i]], num[i])] = ans[num[i]];

            K = M.begin()->first;
            V = M.begin()->second;

            M.erase(K);
            ans[K.second]++;
            K.first++;
            V++;
            M[K] = V;
            num[i] = K.second;
        }
    }

    for(int i = 1;i <= n; ++i)
    {
        if(ans[num[i]] > avg)
        {
            key K = M.find(make_pair(ans[num[i]], num[i]))->first;
            int V = M.find(make_pair(ans[num[i]], num[i]))->second;

            M.erase(K);
            ans[num[i]]--;

            M[make_pair(ans[num[i]], num[i])] = ans[num[i]];

            K = M.begin()->first;
            V = M.begin()->second;

            M.erase(K);
            ans[K.second]++;
            K.first++;
            V++;
            M[K] = V;
            num[i] = K.second;
        }
    }

    if(old != n)
    {
        for(int i = old+1;i <= n; ++i)
        {
            mark[num[i]]++;
        }

        for(int i = 1;i <= m; ++i)
        {
            for(int abcd = 2; abcd <= mark[i]; ++abcd)
            {
                int j;
                for(j = 1;j <= old; ++j)
                {
                    if(num[j] != tmp[j] && mark[num[j]] == 0)
                    {
                            mark[num[j]] = -1;
                            num[j] = i;
                            break;
                    }
                }
                if(j <= old) continue;
                for(j = 1;j <= old; ++j)
                {
                    if(mark[num[j]] == 0)
                    {
                        mark[num[j]] = -1;
                        num[j] = i;
                        break;
                    }
                }
            }
        }
    }

    int p0 = old/m, p1 = 0;

    for(int i = 1;i <= old; ++i)
        if(num[i] != tmp[i]) p1++;

    printf("%d %d\n", p0, p1);

    for(int i = 1;i <= old; ++i)
        printf("%d\n", num[i]);

    return 0;
}


#include <iostream>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

typedef pair<int, int> key;

set<key> s;
map<key,int> M;
map<int,int> ans;

int num[2010], tmp[2010];

int mark[2010] = {0};

int main()
{
    int n, m;

    scanf("%d %d", &n, &m);
    for(int i = 1;i <= m; ++i)
    {
        ans[i] = 0;
        M[make_pair(0, i)] = 0;
    }

    for(int i = 1;i <= n; ++i)
    {
        scanf("%d", &num[i]);

    }

    int old = n;

    while(n%m) num[++n] = 1000000000;

    for(int i = 1;i <= n; ++i)
    {
        tmp[i] = num[i];
        if(num[i] <= m)
        {
            key K = make_pair(ans[num[i]], num[i]);
            int V = M[K];
            ans[num[i]]++;
            M.erase(K);
            K.first++;
            V++;
            M[K] = V;
        }
    }

    for(int i = 1;i <= n; ++i)
    {
        if(num[i] > m)
        {
            key K = M.begin()->first;
            int V = M.begin()->second;
            num[i] = K.second;
            ans[K.second]++;
            M.erase(K);
            K.first++;
            V++;
            M[K] = V;
        }
    }

    int avg = (n+m-1)/m;

    for(int i = 1;i <= n; ++i)
    {
        if(ans[num[i]] > avg)
        {
            key K = M.find(make_pair(ans[num[i]], num[i]))->first;
            int V = M.find(make_pair(ans[num[i]], num[i]))->second;

            M.erase(K);
            ans[num[i]]--;

            M[make_pair(ans[num[i]], num[i])] = ans[num[i]];

            K = M.begin()->first;
            V = M.begin()->second;

            M.erase(K);
            ans[K.second]++;
            K.first++;
            V++;
            M[K] = V;
            num[i] = K.second;
        }
    }

    if(old != n)
    {
        for(int i = old+1;i <= n; ++i)
        {
            mark[num[i]]++;
        }

        for(int i = 1;i <= m; ++i)
        {
            for(int abcd = 2; abcd <= mark[i]; ++abcd)
            {
                int j;
                for(j = 1;j <= old; ++j)
                {
                    if(num[j] != tmp[j] && mark[num[j]] == 0)
                    {
                            mark[num[j]] = -1;
                            num[j] = i;
                            break;
                    }
                }
                if(j <= old) continue;
                for(j = 1;j <= old; ++j)
                {
                    if(mark[num[j]] == 0)
                    {
                        mark[num[j]] = -1;
                        num[j] = i;
                        break;
                    }
                }
            }
        }
    }

    int p0 = old/m, p1 = 0;

    for(int i = 1;i <= old; ++i)
        if(num[i] != tmp[i]) p1++;

    printf("%d %d\n", p0, p1);

    for(int i = 1;i <= old; ++i)
        printf("%d\n", num[i]);

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LL long long

int num[2010];

map<int, int> ans;

int main()
{
	int n, m;

	scanf("%d %d", &n, &m);

	for(int i = 1; i <= n; ++i)
	{
		scanf("%d", &num[i]);
		ans[num[i]]++;
	}

	int avg = n/m;
	map<int,int>::iterator goal;

	int sum = 0;

	for(int i = 1; i <= n; ++i)
	{
		if(num[i] > m || ans[num[i]] > (n+m-1)/m)
		{
			goal = ans.begin();
			if(goal->second < avg)
			{
				goal->second++;
				ans[num[i]]--;
				num[i] = goal->first;
				sum++;
			}
		}
	}

	printf("%d %d\n", avg, sum);

	for(int i = 1;i <= n; ++i)
	{
		printf("%d\n", num[i]);
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LL long long

int num[2010];

map<int, int> ans;

int main()
{
	int n, m;

	scanf("%d %d", &n, &m);

	for(int i = 1; i <= n; ++i)
	{
		scanf("%d", &num[i]);
		ans[num[i]]++;
	}

	int avg = n/m;
	map<int,int>::iterator goal;

	int sum = 0;

	for(int i = 1; i <= n; ++i)
	{
//		printf("i = %d num = %d ans = %d avg = %d\n", i, num[i], ans[num[i]], avg);
		if(num[i] > m || ans[num[i]] > avg)
		{
			goal = ans.begin();
			while(goal != ans.end())
			{
				if(goal->second < avg && goal->first <= m)
				{
					goal->second++;
					ans[num[i]]--;
					num[i] = goal->first;
					sum++;
					break;
				}
				goal++;
			}
		}
	}

	printf("%d %d\n", avg, sum);

	for(int i = 1;i <= n; ++i)
	{
		printf("%d\n", num[i]);
	}

	return 0;
}


#include <iostream>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

typedef pair<int, int> key;

set<key> s;
map<key,int> M;
map<int,int> ans;

int num[2010], tmp[2010];

int mark[2010] = {0};

int main()
{
    int n, m;

    scanf("%d %d", &n, &m);
    for(int i = 1;i <= m; ++i)
    {
        ans[i] = 0;
        M[make_pair(0, i)] = 0;
    }

    for(int i = 1;i <= n; ++i)
    {
        scanf("%d", &num[i]);

    }

    int old = n;

    while(n%m) num[++n] = 1000000000;

    for(int i = 1;i <= n; ++i)
    {
        tmp[i] = num[i];
        if(num[i] <= m)
        {
            key K = make_pair(ans[num[i]], num[i]);
            int V = M[K];
            ans[num[i]]++;
            M.erase(K);
            K.first++;
            V++;
            M[K] = V;
        }
    }

    for(int i = 1;i <= n; ++i)
    {
        if(num[i] > m)
        {
            key K = M.begin()->first;
            int V = M.begin()->second;
            num[i] = K.second;
            ans[K.second]++;
            M.erase(K);
            K.first++;
            V++;
            M[K] = V;
        }
    }

    int avg = n/m;

    for(int i = 1;i <= n; ++i)
    {
        if(ans[num[i]] > avg)
        {
            key K = M.find(make_pair(ans[num[i]], num[i]))->first;
            int V = M.find(make_pair(ans[num[i]], num[i]))->second;

            M.erase(K);
            ans[num[i]]--;

            M[make_pair(ans[num[i]], num[i])] = ans[num[i]];

            K = M.begin()->first;
            V = M.begin()->second;

            M.erase(K);
            ans[K.second]++;
            K.first++;
            V++;
            M[K] = V;
            num[i] = K.second;
        }
    }

    if(old != n)
    {
        for(int i = old+1;i <= n; ++i)
        {
            mark[num[i]]++;
        }

        for(int i = 1;i <= m; ++i)
        {
            for(int abcd = 2; abcd <= mark[i]; ++abcd)
            {
                int j;
                for(j = 1;j <= old; ++j)
                {
                    if(num[j] != tmp[j] && mark[num[j]] == 0)
                    {
                            mark[num[j]] = -1;
                            num[j] = i;
                            break;
                    }
                }
                if(j <= old) continue;
                for(j = 1;j <= old; ++j)
                {
                    if(mark[num[j]] == 0)
                    {
                        mark[num[j]] = -1;
                        num[j] = i;
                        break;
                    }
                }
            }
        }
    }

    int p0 = old/m, p1 = 0;

    for(int i = 1;i <= old; ++i)
        if(num[i] != tmp[i]) p1++;

    printf("%d %d\n", p0, p1);

    for(int i = 1;i <= old; ++i)
        printf("%d\n", num[i]);

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LL long long

int num[2010];

map<int, int> ans;

int main()
{
	int n, m;

	scanf("%d %d", &n, &m);

	for(int i = 1; i <= n; ++i)
	{
		scanf("%d", &num[i]);
		ans[num[i]]++;
	}

	int avg = n/m;
	map<int,int>::iterator goal;

	int sum = 0;

	for(int i = 1; i <= n; ++i)
	{
		if(num[i] > m || ans[num[i]] > (n+m-1)/m)
		{
			goal = ans.begin();
			if(goal->second < avg)
			{
				goal->second++;
				ans[num[i]]--;
				num[i] = goal->first;
				sum++;
			}
		}
	}

	printf("%d %d\n", sum, avg);

	for(int i = 1;i <= n; ++i)
	{
		printf("%d\n", num[i]);
	}

	return 0;
}


#include <iostream>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

typedef pair<int, int> key;

set<key> s;
map<key,int> M;
map<int,int> ans;

int num[2010], tmp[2010];

int main()
{
    int n, m;

    scanf("%d %d", &n, &m);

    for(int i = 1;i <= m; ++i)
    {
        ans[i] = 0;
        M[make_pair(0, i)] = 0;
    }

    for(int i = 1;i <= n; ++i)
    {
        scanf("%d", &num[i]);
        tmp[i] = num[i];
        if(num[i] <= m)
        {
            key K = make_pair(ans[num[i]], num[i]);
            int V = M[K];
            ans[num[i]]++;
            M.erase(K);
            K.first++;
            V++;
            M[K] = V;
        }
    }

    for(int i = 1;i <= n; ++i)
    {
        if(num[i] > m)
        {
            key K = M.begin()->first;
            int V = M.begin()->second;
            num[i] = K.second;
            ans[K.second]++;
            M.erase(K);
            K.first++;
            V++;
            M[K] = V;
        }
    }

    int avg = (n+m-1)/m;

    for(int i = 1;i <= n; ++i)
    {
        if(ans[num[i]] > avg)
        {
            key K = M.find(make_pair(ans[num[i]], num[i]))->first;
            int V = M.find(make_pair(ans[num[i]], num[i]))->second;

            M.erase(K);
            ans[num[i]]--;

            M[make_pair(ans[num[i]], num[i])] = ans[num[i]];

            K = M.begin()->first;
            V = M.begin()->second;

            M.erase(K);
            ans[K.second]++;
            K.first++;
            V++;
            M[K] = V;
            num[i] = K.second;
        }
    }

    int p0 = n/m, p1 = 0;

    for(int i = 1;i <= n; ++i)
        if(num[i] != tmp[i]) p1++;

    printf("%d %d\n", p0, p1);

    for(int i = 1;i <= n; ++i)
        printf("%d\n", num[i]);

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LL long long

int num[2010];

map<int, int> ans;

int main()
{
	int n, m;

	scanf("%d %d", &n, &m);

	for(int i = 1; i <= n; ++i)
	{
		scanf("%d", &num[i]);
		ans[num[i]]++;
	}

	int avg = n/m;
	map<int,int>::iterator goal;

	int sum = 0;

	for(int i = 1; i <= n; ++i)
	{
		printf("i = %d num = %d ans = %d avg = %d\n", i, num[i], ans[num[i]], avg);
		if(num[i] > m || ans[num[i]] > avg)
		{
			goal = ans.begin();
			while(goal != ans.end())
			{
				if(goal->second < avg && goal->first <= m)
				{
					goal->second++;
					ans[num[i]]--;
					num[i] = goal->first;
					sum++;
					break;
				}
				goal++;
			}
		}
	}

	printf("%d %d\n", avg, sum);

	for(int i = 1;i <= n; ++i)
	{
		printf("%d\n", num[i]);
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define LL long long

int num[2010];

map<int, int> ans;

int main()
{
	int n, m;

	scanf("%d %d", &n, &m);

	for(int i = 1; i <= m; ++i)
	{
		ans[i] = 0;
	}

	for(int i = 1; i <= n; ++i)
	{
		scanf("%d", &num[i]);
		ans[num[i]]++;
	}

	int avg = n/m;
	map<int,int>::iterator goal;

	int sum = 0;

	for(int i = 1; i <= n; ++i)
	{
		//printf("i = %d num = %d ans = %d avg = %d\n", i, num[i], ans[num[i]], avg);
		if(num[i] > m || ans[num[i]] > avg)
		{
			goal = ans.begin();
			while(goal != ans.end())
			{
				if(goal->second < avg && goal->first <= m)
				{
					goal->second++;
					ans[num[i]]--;
					num[i] = goal->first;
					sum++;
					break;
				}
				goal++;
			}
		}
	}

	printf("%d %d\n", avg, sum);

	for(int i = 1;i <= n; ++i)
	{
		printf("%d\n", num[i]);
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ldb;

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
#define dbg(a) cout << #a << " = " << a << endl

int main() {

	ios_base::sync_with_stdio(false);
    cin.tie(0);

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int n,m;
	cin >> n >> m;
	int cnt = 0;
	vector<int> v(m + 1, 0);
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] <= m) {
			v[a[i]]++;
		}
	}
	int need = n / m;
	for(int i = 1; i <= m; i++) {
		if(v[i] < need) {
			int j = 0;
			while(j < n && v[i] < need) {
				if(a[j] > m) {
					a[j] = i;
					v[i]++;
					cnt++;
				}
				else if(v[a[j]] > need) {
					v[a[j]]--;
					v[i]++;
					a[j] = i;
					cnt++;
				}
				j++;
			}
		}
	}

	int ans = (int) 1e9;
	for(int i = 1; i <= m; i++) {
		ans = min(ans, v[i]);
	}

	cout << ans << " " << cnt << endl;
	for(int i = 0; i < n; i++) {
		cout << a[i] << " ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ldb;

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
#define dbg(a) cout << #a << " = " << a << endl

int main() {

	ios_base::sync_with_stdio(false);
    cin.tie(0);

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int n,m;
	cin >> n >> m;
	int cnt = 0;
	vector<int> v(m + 1, 0);
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] <= m) {
			v[a[i]]++;
		}
	}

	for(int i = 0; i < n; i++) {
		int mn = 1, mx = 1;
		for(int j = 1; j <= m; j++) {
			if(v[j] > v[mx]) {
				mx = j;
			}
			if(v[j] < v[mn]) {
				mn = j;
			}
		}
		if(a[i] > m) {
			a[i] = mn;
			v[mn]++;
			cnt++;
		}
		else if(v[a[i]] - v[mn] > 1) {
			v[mn]++;
			v[a[i]]--;
			a[i] = mn;
			cnt++;
		}
	}

	int ans = (int) 1e9;
	for(int i = 1; i <= m; i++) {
		ans = min(ans, v[i]);
	}

	cout << ans << " " << cnt << endl;
	for(int i = 0; i < n;i ++) {
		cout << a[i] << " ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ldb;

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
#define dbg(a) cout << #a << " = " << a << endl

int main() {

	ios_base::sync_with_stdio(false);
    cin.tie(0);

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int n,m;
	cin >> n >> m;
	int cnt = 0;
	vector<int> v(m + 1, 0);
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] <= m) {
			v[a[i]]++;
		}
	}
	int need = n / m;
	for(int i = 1; i <= m; i++) {
		if(v[i] < need) {
			int j = 0;
			while(j < n && v[i] < need) {
				if(a[j] > m) {
					a[j] = i;
					v[i]++;
					cnt++;
				}
				else if(v[a[j]] > need) {
					v[a[j]]--;
					v[i]++;
					a[j] = i;
					cnt++;
				}
				j++;
			}
		}
	}

	int ans = (int) 1e9;
	for(int i = 1; i < n; i++) {
		ans = min(ans, v[i]);
	}

	cout << ans << " " << cnt << endl;
	for(int i = 1; i < n; i++) {
		cout << a[i] << " ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ldb;

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
#define dbg(a) cout << #a << " = " << a << endl

int main() {

	ios_base::sync_with_stdio(false);
    cin.tie(0);

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int n,m;
	cin >> n >> m;
	int cnt = 0;
	vector<int> v(m + 1, 0);
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] <= m) {
			v[a[i]]++;
		}
	}

	for(int i = 0; i < n; i++) {
		int mn = 1;
		for(int j = 1; j <= m; j++) {
			if(v[j] < v[mn]) {
				mn = j;
			}
		}
		if(a[i] > m) {
			a[i] = mn;
			v[mn]++;
			cnt++;
		}
	}

	for(int i = 0; i < n; i++) {
		int mn = 1, mx = 1;
		for(int j = 1; j <= m; j++) {
			if(v[j] < v[mn]) {
				mn = j;
			}
			if(v[j] > v[mx]) {
				mx = j;
			}
		}
		if(a[i] == mx && v[mx] - v[mn] > 1) {
			v[mn]++;
			v[mx]--;
			a[i] = mn;
			cnt++;
		}
	}

	int ans = (int) 1e9;
	for(int i = 1; i <= m; i++) {
		ans = min(ans, v[i]);
	}

	cout << ans << " " << cnt << endl;
	for(int i = 0; i < n;i ++) {
		cout << a[i] << " ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ldb;

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
#define dbg(a) cout << #a << " = " << a << endl

int main() {

	ios_base::sync_with_stdio(false);
    cin.tie(0);

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int n,m;
	cin >> n >> m;
	int cnt = 0;
	vector<int> v(m + 1, 0);
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] <= m) {
			v[a[i]]++;
		}
	}

	for(int i = 0; i < n; i++) {
		int mn = 1, mx = 1;
		for(int j = 1; j <= m; j++) {
			if(v[j] > v[mx]) {
				mx = j;
			}
			if(v[j] < v[mn]) {
				mn = j;
			}
		}
		if(a[i] > m) {
			a[i] = mn;
			v[mn]++;
			cnt++;
		}
		else if(a[i] == mx && v[mx] - v[mn] > 1) {
			a[i] = mn;
			v[mn]++;
			v[mx]--;
			cnt++;
		}
	}

	int ans = (int) 1e9;
	for(int i = 1; i <= m; i++) {
		ans = min(ans, v[i]);
	}

	cout << ans << " " << cnt << endl;
	for(int i = 0; i < n;i ++) {
		cout << a[i] << " ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ldb;

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
#define dbg(a) cout << #a << " = " << a << endl

int main() {

	ios_base::sync_with_stdio(false);
    cin.tie(0);

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int n,m;
	cin >> n >> m;
	int cnt = 0;
	vector<int> v(m + 1, 0);
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] <= m) {
			v[a[i]]++;
		}
	}

	for(int i = 0; i < n; i++) {
		int mn = 1;
		for(int j = 1; j <= m; j++) {
			if(v[j] < v[mn]) {
				mn = j;
			}
		}
		if(a[i] > m) {
			a[i] = mn;
			v[mn]++;
			cnt++;
		}
	}

	for(int i = 0; i < n; i++) {
		int mn = 1;
		for(int j = 1; j <= m; j++) {
			if(v[j] < v[mn]) {
				mn = j;
			}
		}
		if(v[a[i]] - v[mn] > 1) {
			v[mn]++;
			v[a[i]]--;
			a[i] = mn;
			cnt++;
		}
	}

	int ans = (int) 1e9;
	for(int i = 1; i <= m; i++) {
		ans = min(ans, v[i]);
	}

	cout << ans << " " << cnt << endl;
	for(int i = 0; i < n;i ++) {
		cout << a[i] << " ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ldb;

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
#define dbg(a) cout << #a << " = " << a << endl

int main() {

	ios_base::sync_with_stdio(false);
    cin.tie(0);

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int n,m;
	cin >> n >> m;
	int cnt = 0;
	vector<int> v(m + 1, 0);
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] <= m) {
			v[a[i]]++;
		}
	}
	int need = n / m;
	for(int i = 1; i <= m; i++) {
		if(v[i] < need) {
			int j = 0;
			while(j < n && v[i] < need) {
				if(a[j] > m) {
					a[j] = i;
					v[i]++;
					cnt++;
				}
				else if(v[a[j]] > need) {
					v[a[j]]--;
					v[i]++;
					a[j] = i;
					cnt++;
				}
				j++;
			}
		}
	}

	int ans = (int) 1e9;
	for(int i = 1; i < n; i++) {
		ans = min(ans, v[i]);
	}

	cout << ans << " " << cnt << endl;
	for(int i = 0; i < n; i++) {
		cout << a[i] << " ";
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef long double ldb;

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
#define dbg(a) cout << #a << " = " << a << endl

int main() {

	ios_base::sync_with_stdio(false);
    cin.tie(0);

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int n,m;
	cin >> n >> m;
	int cnt = 0;
	vector<int> v(m + 1, 0);
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(a[i] <= m) {
			v[a[i]]++;
		}
	}

	for(int i = 0; i < n; i++) {
		int mn = 1;
		for(int j = 1; j <= m; j++) {
			if(v[j] < v[mn]) {
				mn = j;
			}
		}
		if(a[i] > m) {
			a[i] = mn;
			v[mn]++;
			cnt++;
		}
	}

	while(true) {
		int mn = 1, mx = 1;
		for(int j = 1; j <= m; j++) {
			if(v[j] < v[mn]) {
				mn = j;
			}
			if(v[j] > v[mx]) {
				mx = j;
			}
		}
		if(v[mx] - v[mn] <= 1) {
			break;
		}
		for(int j = 0; j < n; j++) {
			if(v[mx] - v[mn] <= 1) {
				break;
			}
			if(a[j] > m) {
				a[j] = mn;
				cnt++;
			}
			else if(a[j] == mx) {
				v[mx]--;
				v[mn]++;
				a[j] = mn;
				cnt++;
			}
		}
	}

	int ans = (int) 1e9;
	for(int i = 1; i <= m; i++) {
		ans = min(ans, v[i]);
	}

	cout << ans << " " << cnt << endl;
	for(int i = 0; i < n;i ++) {
		cout << a[i] << " ";
	}

	return 0;
}


#include<stdio.h>
#include<string.h>
#include<map>
#include<algorithm>
using namespace std;
const int MAXN=2000+7;
int n,m;
int a[MAXN],c[MAXN];
map<int,int>mp;
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mp[a[i]]++;
    }
    int k=n/m,ans=0;
    int cnt=1;
    for(int i=1;i<=n;i++)
    {
        if(a[i]>m || mp[a[i]]>k)
        {
            while(cnt<=m && mp[cnt]>=k)
            {
                cnt++;
            }
            if(cnt<=k)
            {
                ans++;
                mp[a[i]]--;
                a[i]=cnt;
                mp[cnt]++;
            }
        }
    }
    printf("%d %d\n",k,ans);
    for(int i=1;i<=n;i++)
        printf("%d ",a[i]);
}


#include<stdio.h>
#include<string.h>
#include<map>
#include<algorithm>
using namespace std;
const int MAXN=2000+7;
int n,m;
int a[MAXN],c[MAXN];
map<int,int>mp;
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mp[a[i]]++;
    }
    int k=n/m,ans=0;
    int cnt=1;
    for(int i=1;i<=n;i++)
    {
        if(a[i]>m || mp[a[i]]>k)
        {
            while(cnt<=m && mp[cnt]>=k)
            {
                cnt++;
            }
            if(cnt<=m)
            {
                ans++;
                mp[a[i]]--;
                a[i]=cnt;
                mp[cnt]++;
            }
        }
    }
    printf("%d %d\n",k,ans);
    for(int i=1;i<=n;i++)
        printf("%d ",a[i]);
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int ave(int b[],int ans,int m)
{
	int k=0;
	for(int i=1;i<=m;i++)
	if(b[i]>=ans)
	k++;
	if(k<m)
	return 0;
	else
	return 1;
}
int main()
{
	int m,n,i,j;
	while(~scanf("%d%d",&n,&m))
	{
		int a[2005]={0},b[2005]={0};
		for(i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i]<=m)
			b[a[i]]++;
		}
		int ans=n/m,MIN=0,MAX=0,Max=0,x=0,y=0,Min=100000,sum=0;
		if(!ans)
		ans++;
		for(i=1;i<=m;i++)
		{
			if(b[i]>MAX)
			{
				MAX=b[i];
				Max=i;
			}
			if(Min>b[i])
			{
				Min=b[i];
	//			printf("%d\n",Min);
				x=b[i];
				MIN=i;
	//			printf("%d\n",Min);
			}
	//		printf("%d  %d\n",b[i],i);
			sum+=b[i];
		}
//		printf("MAX=%d Min=%d MIN=%d SUM%d\n",MAX,Min,MIN,sum);
//		printf("%d  %d\n",b[Min],ans);
		while(!ave(b,ans,m))
		{
	//		printf("fake\n");
			if(sum<n)
			{
			for(j=1;j<=n;j++)
			{
			if(a[j]>m)
			{
				a[j]=MIN;
				b[MIN]++;
				x++;
				y++;
				sum++;
				Min=100000,MAX=0;
			for(i=1;i<=m;i++)
			{
				if(b[i]>MAX)
				{
					MAX=b[i];
					Max=i;
				}
				if(Min>b[i])
				{
					Min=b[i];
					x=b[i];
					MIN=i;
				}
			}
			}
			if(ave(b,ans,m))
			break;
			if(sum==n)
			break;
			}
			}
			if(ave(b,ans,m))
			break;
			if(sum==n)
			{
	//			printf("sum%d\n",sum);
			for(j=1;j<=n;j++)
			if(Max==a[j])
			{
		//		printf("fake\n");
				a[j]=MIN;
				b[MIN]++;
				x++;
				y++;
				Min=100000,MAX=0;
				for(i=1;i<=m;i++)
				{
					if(b[i]>MAX)
					{
						MAX=b[i];
						Max=i;
					}
					if(Min>b[i])
					{
					Min=b[i];
					x=b[i];
					MIN=i;
					}
				}
//				printf("MAX=%d Min=%d MIN=%d SUM%d\n",MAX,Min,MIN,sum);
//				for(int ii=1;ii<n;ii++)
//				printf("!!%d ",a[ii]);
//				printf("\n");
				if(ave(b,ans,m))
				break;
			}
			}
		}
		printf("%d %d\n",x,y);
		for(i=1;i<n;i++)
		printf("%d ",a[i]);
		printf("%d\n",a[n]);
	}
}


#include<stdio.h>
#include<string.h>
#include<map>
#include<algorithm>
using namespace std;
const int MAXN=2000+7;
int n,m;
int a[MAXN],c[MAXN];
map<int,int>mp;
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mp[a[i]]++;
    }
    int k=n/m,ans=0;
    int cnt=1;
    for(int i=1;i<=n;i++)
    {
        if(a[i]>m || mp[a[i]]>k)
        {
            while(cnt<=m && mp[cnt]<=k)
            {
                cnt++;
            }
            if(cnt<=k)
            {
                ans++;
                mp[a[i]]--;
                a[i]=cnt;
                mp[cnt]++;
            }
        }
    }
    printf("%d %d\n",k,ans);
    for(int i=1;i<=n;i++)
        printf("%d ",a[i]);
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
	int m,n,i,j;
	while(~scanf("%d%d",&n,&m))
	{
		int a[2005]={0},b[2005]={0};
		for(i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i]<=m)
			b[a[i]]++;
		}
		int ans=n/m,MIN=0,MAX=0,Max=0,x=0,y=0,Min=100000,sum=0;
//		if(!ans)
//		ans++;
		for(i=1;i<=m;i++)
		{
			if(b[i]>MAX)
			{
				MAX=b[i];
				Max=i;
			}
			if(Min>b[i])
			{
				Min=b[i];
	//			printf("%d\n",Min);
				x=b[i];
				MIN=i;
	//			printf("%d\n",Min);
			}
	//		printf("%d  %d\n",b[i],i);
			sum+=b[i];
		}
//		printf("MAX=%d Min=%d MIN=%d SUM%d\n",MAX,Min,MIN,sum);
//		printf("%d  %d\n",b[Min],ans);
		while(b[MIN]<ans)
		{
	//		printf("fake\n");
			if(sum<n)
			{
			for(j=1;j<=n;j++)
			{
			if(a[j]>m)
			{
				a[j]=MIN;
				b[MIN]++;
				x++;
				y++;
				sum++;
				Min=100000,MAX=0;
			for(i=1;i<=m;i++)
			{
				if(b[i]>MAX)
				{
					MAX=b[i];
					Max=i;
				}
				if(Min>b[i])
				{
					Min=b[i];
					x=b[i];
					MIN=i;
				}
			}
			}
			if(sum==n)
			break;
			}
			}
			if(b[MIN]>=ans)
			break;
			if(sum==n)
			{
	//			printf("sum%d\n",sum);
			for(j=1;j<=n;j++)
			if(Max==a[j])
			{
		//		printf("fake\n");
				a[j]=MIN;
				b[MIN]++;
				x++;
				y++;
				Min=100000,MAX=0;
				for(i=1;i<=m;i++)
				{
					if(b[i]>MAX)
					{
						MAX=b[i];
						Max=i;
					}
					if(Min>b[i])
					{
					Min=b[i];
					x=b[i];
					MIN=i;
					}
				}
//				printf("MAX=%d Min=%d MIN=%d SUM%d\n",MAX,Min,MIN,sum);
//				for(int ii=1;ii<n;ii++)
//				printf("!!%d ",a[ii]);
//				printf("\n");
				if(b[MIN]>=ans)
				break;
			}
			}
		}
		printf("%d %d\n",x,y);
		for(i=1;i<n;i++)
		printf("%d ",a[i]);
		printf("%d\n",a[n]);
	}
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int ave(int b[],int ans,int m)
{
	int k=0;
	for(int i=1;i<=m;i++)
	if(b[i]>=ans)
	k++;
	if(k<m)
	return 0;
	else
	return 1;
}
int main()
{
	int m,n,i,j;
	while(~scanf("%d%d",&n,&m))
	{
		int a[2005]={0},b[2005]={0},sum=0,ans=n/m;
		for(i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i]<=m)
			b[a[i]]++;
		}
		for(i=1;i<=n;i++)
		{
			if(a[i]>m)
			for(j=1;j<=m;j++)
			{
				if(b[j]<ans)
				{
					a[i]=j;
					b[j]++;
					sum++;
					break;
				}
			}
		}
		for(i=1;i<=n;i++)
		{
			if(b[a[i]]>ans)
			{
				for(j=1;j<=m;j++)
				{
					if(b[j]<ans)
					{
						b[a[i]]--;
						a[i]=j;
						b[j]++;
						sum++;
						break;
					}
				}
			}
		}
		printf("%d %d\n",ans,sum);
		for(i=1;i<n;i++)
		printf("%d ",a[i]);
		printf("%d\n",a[n]);
	}
}


//
// Created by wulang on 10/3/16.
//

#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;

const int N=2000+10;
int a[N], n,m;
int cnt[N];
int main(int argc, char *argv[]) {
    if (argc == 2) {
        freopen(argv[1], "r", stdin);
    }

    while(cin>>n>>m) {
        for(int i=0;i<n;i++) cin>>a[i];
        for(int i=1;i<=m;i++) cnt[i]=0;
        for(int i=0;i<n;i++) {
            if(a[i]<=m) cnt[a[i]]++;
        }

        if(n<m) {
            int ans=1,change=0;
            for(int i=1;i<=m;i++) {
                if(cnt[i]>=1) continue;
                for(int j=0;j<n && cnt[i]<1;j++) {
                    if(a[j]>m) {
                        a[j] = i;
                        cnt[i]++;
                        change++;
                    } else if(cnt[a[j]]>1) {
                        cnt[a[j]]--;
                        a[j]=i;
                        cnt[i]++;
                        change++;
                    }
                }

            }
            cout<<ans<<" "<<change<<endl;
            for(int i=0;i<n;i++) {
                printf("%d%c",a[i], i==n-1?'\n':' ');
            }

            continue;
        }
        int ans= n/m;

        int change=0;
        for(int i=1;i<=m;i++) {
            if(cnt[i]>=ans) continue;
            for(int j=0; j<n && cnt[i]<ans; j++) {
                if(a[j]>m) {
                    a[j] = i;
                    cnt[i]++;
                    change++;
                }
            }

            for(int j=0; j<n && cnt[i]<ans;j++) {
                if(cnt[a[j]]>ans+1) {
                    cnt[a[j]]--;
                    a[j] = i;
                    cnt[i]++;
                    change++;
                }
            }
            for(int j=0; j<n && cnt[i]<ans; j++) {
                if(cnt[a[j]]>ans) {
                    cnt[a[j]]--;
                    a[j]=i;
                    cnt[i]++;
                    change++;
                }
            }
        }

        for(int j=0;j<n;j++) {
            if(a[j]>m) {
                for(int i=1;i<=m;i++) {
                    if(cnt[i]<ans+1) {
                        a[j]=i;
                        cnt[i]++;
                        change++;
                    }
                }
            }
        }

        cout<<ans<<" "<<change<<endl;
        for(int i=0;i<n;i++) {
            printf("%d%c",a[i], i==n-1?'\n':' ');
        }

    }

    return 0;
}


//
// Created by wulang on 10/3/16.
//

#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;

const int N=2000+10;
int a[N], n,m;
int cnt[N];
int main(int argc, char *argv[]) {
    if (argc == 2) {
        freopen(argv[1], "r", stdin);
    }

    while(cin>>n>>m) {
        for(int i=0;i<n;i++) cin>>a[i];
        for(int i=1;i<=m;i++) cnt[i]=0;
        for(int i=0;i<n;i++) {
            if(a[i]<=m) cnt[a[i]]++;
        }

        int ans= n/m;

        int change=0;
        for(int i=1;i<=m;i++) {
            if(cnt[i]>=ans) continue;
            for(int j=0; j<n && cnt[i]<ans; j++) {
                if(a[j]>m) {
                    a[j] = i;
                    cnt[i]++;
                    change++;
                }
            }

            for(int j=0; j<n && cnt[i]<ans;j++) {
                if(cnt[a[j]]>ans+1) {
                    cnt[a[j]]--;
                    a[j] = i;
                    cnt[i]++;
                    change++;
                }
            }
            for(int j=0; j<n && cnt[i]<ans; j++) {
                if(cnt[a[j]]>ans) {
                    cnt[a[j]]--;
                    a[j]=i;
                    cnt[i]++;
                    change++;
                }
            }
        }

        for(int j=0;j<n;j++) {
            if(a[j]>m) {
                a[j]=1;
                change++;
            }
        }

        cout<<ans<<" "<<change<<endl;
        for(int i=0;i<n;i++) {
            printf("%d%c",a[i], i==n-1?'\n':' ');
        }

    }

    return 0;
}


//
// Created by wulang on 10/3/16.
//

#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;

const int N=2000+10;
int a[N], n,m;
int cnt[N];
int main(int argc, char *argv[]) {
    if (argc == 2) {
        freopen(argv[1], "r", stdin);
    }

    while(cin>>n>>m) {
        for(int i=0;i<n;i++) cin>>a[i];
        for(int i=1;i<=m;i++) cnt[i]=0;
        for(int i=0;i<n;i++) {
            if(a[i]<=m) cnt[a[i]]++;
        }

        int ans= n/m;

        int change=0;
        for(int i=1;i<=m;i++) {
            if(cnt[i]>=ans) continue;
            for(int j=0; j<n && cnt[i]<ans; j++) {
                if(a[j]>m) {
                    a[j] = i;
                    cnt[i]++;
                    change++;
                }
            }

            for(int j=0; j<n && cnt[i]<ans;j++) {
                if(cnt[a[j]]>ans+1) {
                    cnt[a[j]]--;
                    a[j] = i;
                    cnt[i]++;
                    change++;
                }
            }
            for(int j=0; j<n && cnt[i]<ans; j++) {
                if(cnt[a[j]]>ans) {
                    cnt[a[j]]--;
                    a[j]=i;
                    cnt[i]++;
                    change++;
                }
            }
        }

//        for(int j=0;j<n;j++) {
//            if(a[j]>m) {
//                a[j]=1;
//                change++;
//            }
//        }

        cout<<ans<<" "<<change<<endl;
        for(int i=0;i<n;i++) {
            printf("%d%c",a[i], i==n-1?'\n':' ');
        }

    }

    return 0;
}


//
// Created by wulang on 10/3/16.
//

#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;

const int N=2000+10;
int a[N], n,m;
int cnt[N];
int main(int argc, char *argv[]) {
    if (argc == 2) {
        freopen(argv[1], "r", stdin);
    }

    while(cin>>n>>m) {
        for(int i=0;i<n;i++) cin>>a[i];
        for(int i=1;i<=m;i++) cnt[i]=0;
        for(int i=0;i<n;i++) {
            if(a[i]<=m) cnt[a[i]]++;
        }

        if(n<m) {
            int ans=0,change=0;
            bool flag=0;
            for(int i=0;i<n;i++) {
                if(a[i]>m) {
                    a[i]=1;
                    change++;
                }
            }
            cout<<ans<<" "<<change<<endl;
            for(int i=0;i<n;i++) {
                printf("%d%c",a[i], i==n-1?'\n':' ');
            }
            continue;
        }

        int ans= n/m;

        int change=0;
        for(int i=1;i<=m;i++) {
            if(cnt[i]>=ans) continue;
            for(int j=0; j<n && cnt[i]<ans; j++) {
                if(a[j]>m) {
                    a[j] = i;
                    cnt[i]++;
                    change++;
                }
            }

            for(int j=0; j<n && cnt[i]<ans;j++) {
                if(cnt[a[j]]>ans+1) {
                    cnt[a[j]]--;
                    a[j] = i;
                    cnt[i]++;
                    change++;
                }
            }
            for(int j=0; j<n && cnt[i]<ans; j++) {
                if(cnt[a[j]]>ans) {
                    cnt[a[j]]--;
                    a[j]=i;
                    cnt[i]++;
                    change++;
                }
            }
        }

        for(int j=0;j<n;j++) {
            if(a[j]>m) {
                a[j]=1;
                change++;
            }
        }

        cout<<ans<<" "<<change<<endl;
        for(int i=0;i<n;i++) {
            printf("%d%c",a[i], i==n-1?'\n':' ');
        }

    }

    return 0;
}