#include <iostream>
using namespace std;
int main()
{
int n, m;
cout << "n="; cin >> n;
cout << "m="; cin >> m;
int a[n+1], b[m+1], i, j, ok;
for(i=1;i<=n;i++)
{
cout << "a[" << i << "]=";
cin >> a[i];
}
for(i=1;i<=m;i++)
{
cout << "b[" << i << "]=";
cin >> b[i];
}
for(i=1;i<=n;i++)
{
ok=1;
for(j=1;j<=m;j++)
{
if(a[i]==b[j]) ok=0;
}
if(ok==1) cout << a[i] << " ";
}
return 0;
}