#include <bits/stdc++.h>
using namespace std;
long long int ans;
int arr[300009];
vector<int> vr;
void solve() {
  int frogsj[1000], mosqhill[1000];
  int n;
  cin >> n;
  int m, k;
  cin >> m >> k;
  for (int i = 0; i < m; ++i) cin >> frogsj[i];
  for (int i = 0; i < k; ++i) cin >> mosqhill[i];
  vector<pair<int, int> > vrp;
  int nin = 1000000;
  for (int i = 0; i < m; ++i) {
    int cnt = 0;
    for (int j = 0; j < k; ++j) {
      if (mosqhill[j] % frogsj[i] == 0) cnt++;
    }
    vrp.push_back({cnt, i + 1});
    nin = min(cnt, nin);
  }
  sort(vrp.begin(), vrp.end());
  for (auto v : vrp) {
    if (v.first == nin)
      ans++;
    else
      break;
  }
  cout << ans << '\n';
  for (auto v : vrp) {
    if (v.first == nin)
      cout << v.second << ' ';
    else
      break;
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int testc = 1;
  for (int t = 0; t < testc; ++t) {
    solve();
  }
  return 0;
}
