#include <bits/stdc++.h>
using namespace std;
int binarySearch(vector<int> arr, int l, int r, int x) {
  if (r >= l) {
    int mid = l + (r - l) / 2;
    if (arr[mid] == x) return 1;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  std::vector<int> vectm;
  std::vector<int> vectk;
  for (int i = 0; i < m; i++) {
    int temp;
    cin >> temp;
    vectm.push_back(temp);
  }
  for (int i = 0; i < k; i++) {
    int temp;
    cin >> temp;
    vectk.push_back(temp);
  }
  std::vector<int> countvec(m, 0);
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < k; j++) {
      if (vectk[j] % vectm[i] == 0) countvec[i]++;
    }
  }
  int min = *min_element(countvec.begin(), countvec.end());
  std::vector<int> elem;
  int count = 0;
  for (int i = 0; i < m; i++) {
    if (countvec[i] == min) {
      elem.push_back(i + 1);
      count++;
    }
  }
  cout << count << endl;
  for (int i = 0; i < elem.size(); i++) {
    cout << elem[i] << " ";
  }
  cout << endl;
}
