#include <bits/stdc++.h>
using namespace std;
struct node {
  int pop;
  int name;
  int time;
} pp[110];
bool cmp(node a, node b) {
  if (a.time == b.time) return a.pop < b.pop;
  return a.time < b.time;
}
int main() {
  int n, m, k;
  int x;
  while (cin >> n >> m >> k) {
    for (int i = 0; i < m; i++) {
      scanf("%d", &pp[i].name);
      pp[i].time = 0;
      pp[i].pop = i + 1;
    }
    for (int i = 0; i < k; i++) {
      scanf("%d", &x);
      for (int j = 0; j < m; j++) {
        if (x % pp[j].name == 0) pp[j].time++;
      }
    }
    sort(pp, pp + m, cmp);
    int ans = 1;
    for (int i = 1; i < m; i++) {
      if (pp[i].time == pp[i - 1].time)
        ans++;
      else
        break;
    }
    printf("%d\n", ans);
    int p = 0;
    for (int i = 0; i < ans; i++) {
      if (p++ != 0) printf(" ");
      printf("%d", pp[i].pop);
    }
  }
  return 0;
}
