#include <bits/stdc++.h>
using namespace std;
int n, m, k, i, j, l, a[1000], b[2000], c[3000], minn, kol;
int main() {
  cin >> n >> m >> k;
  for (i = 1; i < m + 1; i++) cin >> a[i];
  for (j = 1; j < k + 1; j++) cin >> b[j];
  minn = k + 2;
  for (i = 1; i < m + 1; i++) {
    for (j = 1; j < k + 1; j++)
      if (b[j] % a[i] == 0) c[i]++;
    if (c[i] < minn) minn = c[i];
  }
  for (i = 1; i < m + 1; i++)
    if (c[i] == minn) kol++;
  cout << kol << endl;
  for (i = 1; i < m + 1; i++)
    if (c[i] == minn) cout << i << " ";
  return 0;
}
