#include <bits/stdc++.h>
using namespace std;
int n, k, m, i, a[101], b[101], c[101], d = 1000000001, e, j;
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= m; i++) cin >> a[i];
  for (i = 1; i <= k; i++) cin >> b[i];
  for (i = 1; i <= m; i++) {
    for (j = 1; j <= k; j++) {
      if (b[j] % a[i] == 0) c[i]++;
    }
    if (c[i] < d) d = c[i];
  }
  for (i = 1; i <= m; i++)
    if (c[i] == d) e++;
  cout << e << endl;
  for (i = 1; i <= m; i++)
    if (c[i] == d) cout << i << " ";
  return 0;
}
