#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
const int MAXN = 1100000;
int a[MAXN], b[MAXN];
vector<int> v;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < (int)(m); ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < (int)(k); ++i) {
    cin >> b[i];
  }
  int ans = m * k * m * k + 3;
  for (int i = 0; i < (int)(m); ++i) {
    int cur = 0;
    for (int j = 0; j < (int)(k); ++j) {
      if (b[j] % a[i]) continue;
      ++cur;
    }
    if (cur < ans) {
      v.clear();
      v.push_back(i + 1);
      ans = cur;
      continue;
    }
    if (cur == ans) {
      v.push_back(i + 1);
    }
  }
  cout << v.size() << endl;
  for (int i = 0; i < (int)(v.size()); ++i) {
    cout << v[i] << " ";
  }
  return 0;
}
