#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigMod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = ((long long)p * p) % M;
  }
  return (T)ret;
}
int n, p, s;
struct Node {
  int x, y, i;
  inline bool operator<(const Node &a) const { return x > a.x; }
} ar[3003];
int DP[3003][3003];
int pp[3003][3003];
inline int solve(int pos, int second) {
  if (second == s and pos - second >= p or pos == n) return 0;
  auto &ret = DP[pos][second];
  auto &id = pp[pos][second];
  if (~ret) return ret;
  ret = 0;
  int tmp;
  if (second == s)
    ret = solve(pos + 1, second) + ar[pos].x, id = 0;
  else if (pos - second >= p) {
    ret = solve(pos + 1, second), id = 1;
    tmp = solve(pos + 1, second + 1) + ar[pos].y;
    if (tmp > ret) ret = tmp, id = 2;
  } else {
    ret = solve(pos + 1, second) + ar[pos].x, id = 3;
    tmp = solve(pos + 1, second + 1) + ar[pos].y;
    if (tmp > ret) ret = tmp, id = 4;
  }
  return ret;
}
vector<int> a, b;
inline void pathPrint(int pos, int second) {
  if (second == s and pos - second >= p or pos == n) return;
  auto &ret = DP[pos][second];
  auto &id = pp[pos][second];
  if (id == 0) {
    a.push_back(ar[pos].i);
    pathPrint(pos + 1, second);
  }
  if (id == 1) {
    pathPrint(pos + 1, second);
  }
  if (id == 2) {
    pathPrint(pos + 1, second + 1);
    b.push_back(ar[pos].i);
  }
  if (id == 3) {
    pathPrint(pos + 1, second);
    a.push_back(ar[pos].i);
  }
  if (id == 4) {
    pathPrint(pos + 1, second + 1);
    b.push_back(ar[pos].i);
  }
}
int main() {
  scanf("%d %d %d", &n, &p, &s);
  for (int i = int(0); i <= int(n - 1); i++) scanf("%d", &ar[i].x);
  for (int i = int(0); i <= int(n - 1); i++) scanf("%d", &ar[i].y), ar[i].i = i;
  sort(ar, ar + n);
  memset(DP, -1, sizeof(DP));
  printf("%d\n", solve(0, 0));
  pathPrint(0, 0);
  for (auto &x : a) {
    printf("%d ", x + 1);
  }
  printf("\n");
  for (auto &x : b) {
    printf("%d ", x + 1);
  }
  printf("\n");
  return 0;
}
