#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, min = INT_MAX;
  cin >> n >> m >> k;
  int a[m], b[k], count = 0;
  int mk[100][100];
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i < k; i++) cin >> b[i];
  for (int i = 0; i < m; i++) {
    count = 0;
    for (int j = 0; j < k; j++)
      if (b[j] % a[i] == 0) count++;
    if (count < min) min = count;
  }
  int c = 0;
  for (int i = 0; i < m; i++) {
    count = 0;
    for (int j = 0; j < k; j++)
      if (b[j] % a[i] == 0) count++;
    if (count == min) {
      c++;
    }
  }
  cout << c << endl;
  for (int i = 0; i < m; i++) {
    count = 0;
    for (int j = 0; j < k; j++)
      if (b[j] % a[i] == 0) count++;
    if (count == min) cout << i + 1 << " ";
  }
  return 0;
}
