#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long int n, m, k;     cin >> n >> m >> k;     vector<pair<long long int, long long int> > F(n), S(m);     long long int maxDay = 0;     for (long long int i = 0; i < n; i++) {       cin >> F[i].first;       F[i].second = i + 1;       maxDay = max(maxDay, F[i].first);     }     for (long long int i = 0; i < m; i++) {       cin >> S[i].first;       S[i].second = i + 1;     }     long long int f_i = 0, s_i = 0;     sort(F.begin(), F.begin() + F.size());     sort(S.begin(), S.begin() + S.size());     vector<long long int> res;     for (long long int i = 0; i <= maxDay; i++) {       long long int use = 0;       while (use < k && f_i < F.size() && F[f_i].first == i) {         f_i++;         use++;       }       if (use == k && f_i < F.size() && F[f_i].first == i) {         cout <<  -1 ;         return 0;       }       while (s_i < S.size() && S[s_i].first < i) s_i++;       while (use < k && s_i < S.size() && S[s_i].first >= i) {         res.push_back(S[s_i].second);         use++;         s_i++;       }       while (use < k && f_i < F.size() && F[f_i].first > i) {         use++;         f_i++;       }     }     for (long long int i = maxDay + 1; s_i < S.size(); i++) {       long long int use = 0;       while (s_i < S.size() && S[s_i].first < i) s_i++;       while (use < k && s_i < S.size() && S[s_i].first >= i) {         res.push_back(S[s_i].second);         s_i++;         use++;       }     }     cout << res.size() <<   n ;     for (auto x : res) cout << x <<    ;   }   