#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
bool Debug = true;
const ll N = 2 * (1e5) + 100;
ll sumn(vector<ll>& n) {
  ll ans = 0;
  for (ll i = 0; i < (n.size()); i++) {
    ans += n[i];
  }
  return ans;
}
string alph = "0123456789abcdefghijklmnopqrstuvwxyz";
double dist(double x1, double x2, double y1, double y2) {
  return sqrt(abs(x1 - x2) * abs(x1 - x2) + abs(y1 - y2) * abs(y1 - y2));
}
struct coords {
  ll x, y;
};
ll pown(ll n, ll cnt, ll mod = INT64_MAX) {
  return cnt == 0 ? 1 % mod
                  : (cnt % 2 ? pown(n * n % mod, cnt / 2, mod) * n % mod
                             : pown(n * n % mod, cnt / 2, mod) % mod);
}
pair<ll, ll> arr[1000005];
ll n, k, a[1000005], b[2000005];
bool OK(ll mid) {
  ll l = 0, r = mid - 1, sz = n + mid;
  for (int i = 0; i < sz; i++) {
    if (r < 0)
      b[i] = a[l++];
    else if (l >= n || a[l] > arr[r].first)
      b[i] = arr[r--].first;
    else
      b[i] = a[l++];
  }
  for (int i = 0; i < sz; i += k) {
    for (int j = i; j < min(sz, i + k); j++) {
      if (b[j] < i / k) return 0;
    }
  }
  return 1;
}
void solve() {
  ll m;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    cin >> arr[i].first;
    arr[i].second = i;
  }
  sort(a, a + n);
  sort(arr, arr + m, greater<pair<ll, ll> >());
  ll st = -1, en = m;
  while (st != en) {
    ll mid = (st + en + 1) / 2;
    if (OK(mid))
      st = mid;
    else
      en = mid - 1;
  }
  cout << st << "\n";
  for (int i = 0; i < st; i++) cout << arr[i].second + 1 << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
