#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define N 105
int n,m,r,a[N],b[N],ans[N],tot;
ll read(){
ll w=0,f=1;
char ch=getchar();
while (ch>'9'||ch<'0'){
if (ch=='-') f=-1;
ch=getchar();
}
while (ch>='0'&&ch<='9'){
w=(w<<3)+(w<<1)+(ch^48);
ch=getchar();
}
return w*f;
}
int main(){
freopen("killer.in","r",stdin);
freopen("killer.out","w",stdout);
n=read(),m=read(),r=read();
for (int i=1;i<=n;i++) a[i]=read();
for (int i=1;i<=m;i++) b[i]=read();
for (int i=1;i<=m;i++){
bool pd=0;
for (int j=1;j<=n;j++){
if (b[i]%a[j]!=0) pd=1;
}
if (!pd){
printf("%d\n",i);
return 0;
}
}
for (int i=1;i<=m;i++){
int cnt=0;
for (int j=1;j<=n;j++){
if (b[i]%a[j]==0) ++cnt;
}
if (cnt>=r) ans[++tot]=i;
}
if (tot){
for (int i=1;i<=tot;i++) printf("%d ",ans[i]);
}else{
puts("0");
}
return 0;
}