#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd (unsigned long long a,unsigned long long b)
{
if (a==0)
{
return b;
}
return gcd(b%a,a);
}
int main()
{
freopen ("killer.in","r",stdin);
freopen ("killer.out","w",stdout);
int m,n,r,a[102]={},b[102]={};
long long ji=1;
cin >> m >> n >> r;
for (int i=1;i<=m;i++)
{
cin >> a[i];
if (ji%a[i]!=0)
{
ji=ji*a[i]/gcd(ji,a[i]);
}
}
for (int i=1;i<=n;i++)
{
cin >> b[i];
if (b[i]%ji==0)
{
cout << i;
return 0;
}
}
int geshu=0;
for (int i=1;i<=n;i++)
{
int shu=0;
for (int j=1;j<=m;j++)
{
if (b[i]%a[j]==0)
{
shu++;
}
if (shu>=r)
{
cout << i << " ";
geshu++;
break;
}
}
}
if (geshu==0)
{
cout << "0";
}
return 0;
}