#include<bits/stdc++.h>
using namespace std;
unordered_set <int> s;
int a[10]={3, 5, 7, 3, 3, 13, 5, 13, 29, 13};
void shift(int i){
do{
a[i]=a[i+1];
i++;
}while(i!=10);
}
int main(){
int tot=0;
for(int i=0;i<10-tot;i++){
if(s.find(a[i])!=s.end()){
tot++;
shift(i);
i--;
}
else{
s.insert(a[i]);
}
}
//printing
for(int j=0;j<10-tot;j++){
printf("%d ",a[j]);
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdW5vcmRlcmVkX3NldCA8aW50PiBzOwppbnQgYVsxMF09ezMsIDUsIDcsIDMsIDMsIDEzLCA1LCAxMywgMjksIDEzfTsKdm9pZCBzaGlmdChpbnQgaSl7CiAgICBkb3sKICAgICAgICAgCiAgICAgICAgYVtpXT1hW2krMV07CiAgICAgICAgaSsrOwogICAgICAgICAKICAgIH13aGlsZShpIT0xMCk7Cn0KaW50IG1haW4oKXsKICAgIGludCB0b3Q9MDsKICAgIGZvcihpbnQgaT0wO2k8MTAtdG90O2krKyl7CiAgICAgICAgaWYocy5maW5kKGFbaV0pIT1zLmVuZCgpKXsKICAgICAgICAgICAgdG90Kys7CiAgICAgICAgICAgIHNoaWZ0KGkpOwogICAgICAgICAgICBpLS07CiAgICAgICAgICAgIAogICAgICAgIH0KICAgICAgICBlbHNlewogICAgICAgICAgICBzLmluc2VydChhW2ldKTsKICAgICAgICB9CiAgICB9CiAgICAgCiAgICAvL3ByaW50aW5nCiAgICBmb3IoaW50IGo9MDtqPDEwLXRvdDtqKyspewogICAgICAgIHByaW50ZigiJWQgIixhW2pdKTsKICAgIH0KICAgICAKICAgICAKICAgICAKICAgICAKICAgICAKICAgICAKICAgICAKICAgICAKICAgICAKICAgIHJldHVybiAwOwp9