#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
int ans[100];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int frog[m], mos[k];
  for (int i = 0; i < m; i++) cin >> frog[i];
  for (int i = 0; i < k; i++) cin >> mos[i];
  int mn = 1e4, x = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < k; j++)
      if (mos[j] % frog[i] == 0) ans[i]++;
    if (ans[i] < mn) {
      x = 1;
      mn = ans[i];
    } else if (ans[i] == mn)
      x++;
  }
  cout << x << "\n";
  for (int i = 0; i < m; i++)
    if (ans[i] == mn) cout << i + 1 << " ";
  return 0;
}
