#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int fr[m + 1];
  int mos[k + 1];
  int kill[m + 1];
  for (int i = 1; i <= m; i++) {
    cin >> fr[i];
    kill[i] = 0;
  }
  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] % fr[i] == 0) {
        kill[i]++;
      }
    }
  }
  int mn = kill[1];
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    if (kill[i] == mn) {
      ans++;
    }
    if (kill[i] < mn) {
      mn = kill[i];
      ans = 1;
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= m; i++) {
    if (kill[i] == mn) {
      cout << i << " ";
    }
  }
}
