#include <bits/stdc++.h>   using namespace std;   int dx[] = {0, 1, -1, 0};   int dy[] = {1, 0, 0, -1};   long double PI = 3.14159265358979323846264338327950;   pair<int, int> p[12000002];   int a[12000002], b[12000002];   int m, n, k;   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cin >> n >> m >> k;     for (int i = 1, x; i <= n; i++) {       cin >> x;       a[x]++;       if (a[x] > k) {         cout << -1;         return 0;       }     }     for (int i = 1, x; i <= m; i++) {       cin >> x;       p[i] = {x, i};     }     sort(p + 1, p + 1 + m);     int ch = 0;     int res = 0;     for (int i = 1; i <= m; i++) {       for (; a[ch] == k; ch++)         ;       if (ch > p[i].first)         continue;       else {         res++;         b[res] = p[i].second, a[ch]++;       }     }     cout << res <<   n ;     for (int i = 1; i <= res; i++) cout << b[i] <<    ;     return 0;   }   