#include <iostream>
#include <vector>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	ios_base::sync_with_stdio(false);
	long long n,k,i;
	cin>>n>>k;
	long long niz[100],niz2[100];
	for(i=0;i<n;i++){
		niz[i]=0;
	}
	int brO=0;
	for(i=0;i<n;i++){
		niz2[i]=0;
	}
	int a;
	for(i=0;i<n;i++){
		cin>>a;
		if(a==0){
			brO++;
		}
		else if(a>0){
			niz2[a]++;
		}
		else{
			niz[n+a]++;
		}
	}
	int br=0;
	vector<long long> v;
	for(i=0;i<n;i++){
		if(niz2[i]>=k){
			br+=niz2[i]/k;
			v.push_back(i);
		}
	}
	br+=brO/k;
	if(brO>=k){
		v.push_back(0);
	}
	for(i=0;i<n;i++){
		if(niz[i]>=k){
			br+=niz[i]/k;
			v.push_back(-(n-i));
		}
	}
	cout<<br<<endl;;
	for(i=0;i<v.size();i++){
		cout<<v[i]<<" ";
	}
	return 0;
}