#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, counter = 0, count = 0, cou = 0, ma = 0;
  cin >> n >> m >> k;
  long long int arr[m], mas[k], ans[m];
  for (long long int i = 0; i < m; i++) {
    cin >> arr[i];
  }
  for (long long int i = 0; i < k; i++) {
    cin >> mas[i];
  }
  for (long long int i = 0; i < m; i++) {
    for (long long int j = 0; j < k; j++) {
      if (mas[j] % arr[i] != 0) {
        cou += 1;
      }
    }
    if (cou > ma) {
      ma = cou;
      counter = 1;
      ans[0] = i + 1;
    } else if (cou == ma) {
      ans[counter] = i + 1;
      counter += 1;
    }
    cou = 0;
  }
  cout << counter << endl;
  for (int i = 0; i < counter; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
