#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, m, k, ans = 0;
  cin >> n >> m >> k;
  vector<long long int> frogs(m), mos(k);
  for (long long int(i) = 0; (i) < (m); (i)++) cin >> frogs[i];
  for (long long int(i) = 0; (i) < (k); (i)++) cin >> mos[i];
  long long int mm = INT_MAX;
  vector<long long int> v;
  for (long long int(i) = 0; (i) < (m); (i)++) {
    long long int ctr = 0;
    for (long long int(j) = 0; (j) < (k); (j)++) {
      if (mos[j] % frogs[i] == 0) ctr++;
    }
    v.push_back(ctr);
    mm = min(mm, ctr);
  }
  for (long long int(i) = 0; (i) < (m); (i)++)
    if (v[i] == mm) ans++;
  cout << ans << endl;
  for (long long int(i) = 0; (i) < (m); (i)++)
    if (v[i] == mm) cout << i + 1 << " ";
  return 0;
}
