#include <bits/stdc++.h>
using namespace std;
vector<int> ans[102];
int main() {
  int i, j, n, m, k, x;
  cin >> n >> m >> k;
  vector<int> d, mo;
  while (m--) {
    cin >> x;
    d.push_back(x);
  }
  while (k--) {
    cin >> x;
    mo.push_back(x);
  }
  m = d.size();
  k = mo.size();
  sort(mo.begin(), mo.end());
  for (i = 0; i < m; i++) {
    int cnt = 0;
    for (j = 0; j < k; j++) {
      if (mo[j] % d[i] == 0) cnt++;
    }
    ans[cnt].push_back(i + 1);
  }
  for (i = 0; i < 101; i++)
    if (ans[i].size()) break;
  cout << ans[i].size() << endl;
  ;
  for (j = 0; j < ans[i].size(); j++) cout << ans[i][j] << " ";
}
