#include <bits/stdc++.h>
using namespace std;
int n, m, p, a[200], b[200], ans[200], f[200];
int main() {
  scanf("%d%d%d", &p, &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (b[j] % a[i] == 0) ++f[i];
  f[0] = 10000;
  for (int i = 1; i <= n; i++) f[0] = min(f[0], f[i]);
  p = 0;
  for (int i = 1; i <= n; i++)
    if (f[0] == f[i]) ans[++p] = i;
  printf("%d\n", p);
  for (int i = 1; i < p; i++) printf("%d ", ans[i]);
  printf("%d\n", ans[p]);
  return 0;
}
