#include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<int> a;
vector<pair<int, int> > b;
int lol[10000001];
bool check(int mid) {
  for (int i = 0; i < mid; ++i) {
    ++lol[b[i].first];
  }
  int sz = 0;
  for (int i = 0; i < 1000001; ++i)
    for (int j = 0; j < lol[i]; ++j) {
      if (sz / k > i) {
        for (int i = 0; i < mid; ++i) {
          --lol[b[i].first];
        }
        return false;
      }
      ++sz;
    }
  for (int i = 0; i < mid; ++i) {
    --lol[b[i].first];
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m >> k;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  b.resize(m);
  for (int i = 0; i < m; ++i) {
    cin >> b[i].first;
    b[i].second = i;
  }
  sort(b.rbegin(), b.rend());
  for (int i = 0; i < n; ++i) ++lol[a[i]];
  int l = -1, r = m;
  while (l < r) {
    int mid = (l + r + 1) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid - 1;
  }
  cout << l << '\n';
  for (int i = 0; i < l; ++i) cout << b[i].second + 1 << ' ';
  return 0;
}
