int main() { int n = 0; scanf("%d", &n); int arr[50] = { 0 };

int a = 0;
int b = 0;
for (a; a < n; a++)
	scanf("%d", &arr[a]);

int del = 0;
scanf("%d", &del);

for (a = 0; a < n; a++)
{
	if (arr[a] != del)
		arr[b++] = arr[a];
}
for (a = 0; a < b; a++)
{
	printf("%d ",arr[a]);
}
return 0;

}