import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sb = new Scanner(System.in);
int n , m ;
boolean flag1 = false;
boolean flag2 = false;
while(sb.hasNext()) {
for(int i = 0;i<10;i++) {
n = sb.nextInt();
m = sb.nextInt();
if(n==0 && m==0) {
break;
}else{
int [] a = new int[n];
int [] b = new int[m];
int [] c = new int[n];
for(int x=0;x<n;x++) {
a[x] = sb.nextInt();
}
for(int x=0;x<m;x++) {
b[x] = sb.nextInt();
}
for(int x=0;x<n;x++) {
for(int y=0;y<m;y++) {
if(a[x]==b[y]){
flag1 = true;
}
}
if(flag1==false){
c[x]=a[x];
}
}
for(int x=0;x<n-1;x++){
if(c[x] != 0){
System.out.println(c[x]+" ");
flag2 = true;
}else if(flag2==false){
System.out.println("NULL");
}
}
}
}
}
}
}
无法输入多行数据,按下回车就开始运行了,代码可能还有错