#include <bits/stdc++.h>
using namespace std;
int n, m, k, a[1000005];
pair<int, int> s[1000005];
bool check(int med) {
  int uk = m - med + 1;
  int day = 0;
  int iter = 1;
  int uk1 = 1;
  while (1) {
    for (int i = 1; i <= k && iter <= n + med; ++i, ++iter) {
      if (uk == m + 1) {
        if (a[uk1] < day) return false;
        ++uk1;
        continue;
      }
      if (uk1 == n + 1) {
        if (s[uk].first < day) return false;
        ++uk;
        continue;
      }
      if (s[uk].first < a[uk1]) {
        if (s[uk].first < day) return false;
        ++uk;
        continue;
      } else {
        if (a[uk1] < day) return false;
        ++uk1;
        continue;
      }
    }
    ++day;
    if (iter == n + med + 1) break;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= m; ++i) cin >> s[i].first, s[i].second = i;
  sort(a + 1, a + n + 1);
  sort(s + 1, s + m + 1);
  int l = -1, r = m + 1;
  while (r - l > 1) {
    int med = (l + r) / 2;
    if (check(med))
      l = med;
    else
      r = med;
  }
  cout << l << '\n';
  for (int i = m; i >= m - l + 1; --i) cout << s[i].second << ' ';
  return 0;
}
