#include <iostream>
#include <string>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
int n, m,t=0;
int a[100], b[100];
int c[100];
bool flag;
while (cin >> n>>m)
{
if (n == 0 && m == 0)
return -1;
flag = true;
t = 0;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int j = 0; j < m; j++)
cin >> b[j];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
if (a[i] == b[j])
flag = false;
}
if (flag == true)
c[t++] = a[i];
flag = true;
}
sort(c, c + t);
if (t == 0)
cout << "NULL";
else
for (int i = 0; i < t; i++)
{
cout << c[i] << " ";
}
cout << endl;
}
return 0;
}
#include <string>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
int n, m,t=0;
int a[100], b[100];
int c[100];
bool flag;
while (cin >> n>>m)
{
if (n == 0 && m == 0)
return -1;
flag = true;
t = 0;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int j = 0; j < m; j++)
cin >> b[j];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
if (a[i] == b[j])
flag = false;
}
if (flag == true)
c[t++] = a[i];
flag = true;
}
sort(c, c + t);
if (t == 0)
cout << "NULL";
else
for (int i = 0; i < t; i++)
{
cout << c[i] << " ";
}
cout << endl;
}
return 0;
}