#include <bits/stdc++.h>
using namespace std;
int z[105] = {0};
int main() {
  long n;
  int k, m;
  cin >> n >> m >> k;
  long *a;
  a = new long[m];
  long *b;
  b = new long[k];
  for (int i = 0; i < m; i++) cin >> *(a + i);
  for (int i = 0; i < k; i++) cin >> *(b + i);
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < k; j++) {
      if (b[j] % a[i] == 0) z[i]++;
    }
  }
  long min = z[0];
  for (int i = 0; i < m; i++)
    if (z[i] < min) min = z[i];
  int h = 0;
  for (int i = 0; i < m; i++) {
    if (z[i] == min) h++;
  }
  long *d;
  int l = 0;
  d = new long[h];
  for (int i = 0; i < m; i++)
    if (z[i] == min) {
      d[l] = i + 1;
      l++;
    }
  stable_sort(d, d + h);
  cout << h << endl;
  for (int i = 0; i < h; i++) cout << d[i] << " ";
  return 0;
}
