#include <bits/stdc++.h>
using namespace std;
pair<pair<int, int>, int> A[3000 + 10];
int n, prog, sport;
bool cmp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  return (a.first.first > b.first.first);
}
int dp[3010][3010];
int call(int pos, int rem_sp) {
  if (pos > n && rem_sp) return dp[pos][rem_sp] = 0;
  if (pos > n) return dp[pos][rem_sp] = 0;
  int rem_prog = prog - (pos - 1 - (sport - rem_sp));
  if (rem_prog <= 0 && rem_sp <= 0) return dp[pos][rem_sp] = 0;
  if (dp[pos][rem_sp] != -1) return dp[pos][rem_sp];
  int ret = 0;
  if (rem_sp > 0) ret = call(pos + 1, rem_sp - 1) + A[pos].first.second;
  if (rem_prog <= 0) ret = max(ret, call(pos + 1, rem_sp));
  if (rem_prog > 0) {
    ret = max(ret, call(pos + 1, rem_sp) + A[pos].first.first);
  }
  return dp[pos][rem_sp] = ret;
}
vector<int> P, S;
void go(int pos, int rem_sp) {
  if (pos > n) return;
  int rem_prog = prog - (pos - 1 - (sport - rem_sp));
  int ret = dp[pos][rem_sp];
  if (rem_prog <= 0 && rem_sp <= 0) return;
  if (rem_sp > 0 && ret == dp[pos + 1][rem_sp - 1] + A[pos].first.second) {
    S.push_back(A[pos].second);
    go(pos + 1, rem_sp - 1);
    return;
  }
  if (rem_prog <= 0 && ret == dp[pos + 1][rem_sp]) {
    go(pos + 1, rem_sp);
    return;
  }
  if (rem_prog > 0 && ret == dp[pos + 1][rem_sp] + A[pos].first.first) {
    P.push_back(A[pos].second);
    go(pos + 1, rem_sp);
    return;
  }
  return;
}
int main() {
  int cs, t, i, j, k;
  memset((dp), -1, sizeof(dp));
  scanf("%d %d %d", &n, &prog, &sport);
  for (i = 1; i <= n; i++) scanf("%d", &A[i].first.first), A[i].second = i;
  for (i = 1; i <= n; i++) scanf("%d", &A[i].first.second);
  sort(A + 1, A + n + 1, cmp);
  printf("%d\n", call(1, sport));
  go(1, sport);
  for (i = 0; i < P.size(); i++) printf("%d ", P[i]);
  puts("");
  for (i = 0; i < S.size(); i++) printf("%d ", S[i]);
  return 0;
}
