#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 3000;
const int INF = INT_MAX / 2;
pair<pair<int, int>, int> P[MAX_N];
int n, p, s;
int AC[MAX_N + 1];
bool used[MAX_N + 1][MAX_N + 1];
int memo[MAX_N + 1][MAX_N + 1];
int dp(int pos, int taken) {
  if (pos == n) return taken == s ? 0 : -INF;
  if (taken > s) return -INF;
  if (used[pos][taken]) return memo[pos][taken];
  used[pos][taken] = 1;
  int mustTake = (pos - taken < p ? P[pos].first.first : 0);
  int &ans = memo[pos][taken] = dp(pos + 1, taken) + mustTake;
  ans = max(ans, P[pos].first.second + dp(pos + 1, taken + 1));
  return ans;
}
map<int, int> mapA;
vector<int> listA, listB;
void rec(int pos, int taken) {
  if (pos == n) {
    if (taken == s) {
      return;
    }
    assert(0);
    return;
  }
  int mustTake = (pos - taken < p ? P[pos].first.first : 0);
  int &ans = memo[pos][taken] = dp(pos + 1, taken) + mustTake;
  ans = max(ans, P[pos].first.second + dp(pos + 1, taken + 1));
  if (dp(pos, taken) == dp(pos + 1, taken) + mustTake) {
    if (mustTake) listA.push_back(P[pos].second);
    rec(pos + 1, taken);
    return;
  }
  if (dp(pos, taken) == P[pos].first.second + dp(pos + 1, taken + 1)) {
    listB.push_back(P[pos].second);
    rec(pos + 1, taken + 1);
    return;
  }
  assert(0);
}
void impr(vector<int> &v) {
  for (int i = 0; i < ((int)v.size()); ++i)
    printf("%d%c", v[i] + 1, ((i + 1 == ((int)v.size())) ? 10 : 32));
}
int main() {
  while (scanf("%d%d%d", &n, &p, &s) == 3) {
    for (int i = 0; i < n; ++i) scanf("%d", &P[i].first.first);
    for (int i = 0; i < n; ++i) scanf("%d", &P[i].first.second);
    for (int i = 0; i < n; ++i) P[i].second = i;
    sort(P, P + n);
    reverse(P, P + n);
    for (int i = 0; i < n; ++i) AC[i + 1] = AC[i] + P[i].first.first;
    memset(used, 0, sizeof(used));
    listA.clear();
    listB.clear();
    printf("%d\n", dp(0, 0));
    rec(0, 0);
    impr(listA);
    impr(listB);
  }
}
