#include <bits/stdc++.h>
using namespace std;
const int mx = (int)2e5 + 6;
int cnt[mx];
int mn = (int)1e9;
vector<int> v[mx];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int d[m + 3], mos[k + 3];
  for (int i = 1; i <= m; ++i) {
    cin >> d[i];
  }
  for (int i = 1; i <= k; ++i) {
    cin >> mos[i];
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = 1; j <= k; ++j) {
      if (mos[j] % d[i] == 0) {
        cnt[i]++;
      }
    }
    v[cnt[i]].push_back(i);
    mn = min(mn, cnt[i]);
  }
  cout << v[mn].size() << endl;
  for (auto u : v[mn]) {
    cout << u << " ";
  }
  cout << endl;
  return 0;
}
