#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, i, n, m, x[500], y[500], s[500] = {0}, kol = 0, j;
  cin >> n >> m >> k;
  for (i = 0; i < m; i++) cin >> x[i];
  for (i = 0; i < k; i++) cin >> y[i];
  for (i = 0; i < m; i++)
    for (j = 0; j < k; j++)
      if (y[j] % x[i] == 0) s[i]++;
  int r = s[0];
  for (i = 0; i < m; i++)
    if (s[i] < r) r = s[i];
  for (i = 0; i < m; i++)
    if (s[i] == r) kol++;
  cout << kol << endl;
  for (i = 0; i < m; i++)
    if (s[i] == r) cout << i + 1 << " ";
  return 0;
}
