#include <stdio.h>
int main()
{
int user[30] = {0,};
int n = 0;
int count = 0;
for (int i = 0; i < 30; i++) {
user[i] = i + 1;
}
while ((n < 0 || n>31) || count!=28)
{
scanf_s("%d", &n);
for (int i = 0; i < 30; i++) {
if (user[i] == n)
user[i] = 0;
else
continue;
}
count++;
}
for (int i = 0; i < 30; i++)
{
if (user[i] > 0)
printf("%d\n", user[i]);
else
continue;
}
return 0;
}