a[999];i=1e5;f;*p=a;main(k){for(;~scanf("%d",p++););for(;i--;f=0)for(p=a;i?*p++=*p-i?*p:-k++-f--:printf("%.d\n",-*p++)-1;);}