#include <bits/stdc++.h>
using namespace std;
int main() {
  int d[128] = {};
  int s[128] = {};
  int n = 0, m = 0, k = 0;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; ++i) scanf("%d", &d[i]);
  for (int j = 0; j < k; ++j) scanf("%d", &s[j]);
  int C = k;
  for (int i = 0; i < m; ++i) {
    int c = 0;
    for (int j = 0; j < k; ++j) {
      if (s[j] % d[i] == 0) c++;
    }
    if (c < C) {
      C = c;
    }
  }
  vector<int> v;
  for (int i = 0; i < m; ++i) {
    int c = 0;
    for (int j = 0; j < k; ++j) {
      if (s[j] % d[i] == 0) c++;
    }
    if (c == C) {
      v.push_back(i + 1);
    }
  }
  printf("%d\n", v.size());
  for (int i = 0; i < v.size(); ++i) printf("%d ", v[i]);
  return 0;
}
