#include <bits/stdc++.h>
using namespace std;
const int N = 3333;
const int INF = 1000000007;
struct Student {
  int prog;
  int sport;
  int id;
} student[N];
int f[N][N];
int n, p, s;
vector<int> sportTeam, progTeam;
pair<int, int> trace[N][N];
bool cmp(Student a, Student b) { return a.prog > b.prog; }
int dp(int a, int b) {
  if (f[a][b] != 0) return f[a][b];
  if (a > n) return 0;
  if (b == s && a - b - 1 >= p) return 0;
  if (b == s) {
    trace[a][b] = make_pair(a + 1, b);
    f[a][b] = dp(a + 1, b) + student[a].prog;
    return f[a][b];
  }
  f[a][b] = dp(a + 1, b + 1) + student[a].sport;
  trace[a][b] = make_pair(a + 1, b + 1);
  if (f[a][b] < dp(a + 1, b)) {
    f[a][b] = dp(a + 1, b);
    trace[a][b] = make_pair(a + 1, b);
  }
  if (a - b - 1 < p && f[a][b] < dp(a + 1, b) + student[a].prog) {
    f[a][b] = dp(a + 1, b) + student[a].prog;
    trace[a][b] = make_pair(a + 1, b);
  }
  return f[a][b];
}
int main() {
  cin >> n >> p >> s;
  for (int i = 1; i <= n; i++) cin >> student[i].prog;
  for (int i = 1; i <= n; i++) cin >> student[i].sport, student[i].id = i;
  sort(student + 1, student + n + 1, cmp);
  cout << dp(1, 0) << endl;
  int A = 1, B = 0;
  while (true) {
    pair<int, int> next = trace[A][B];
    if (next.first == 0) break;
    if (next.second == B + 1)
      sportTeam.push_back(student[A].id);
    else
      progTeam.push_back(student[A].id);
    A = next.first;
    B = next.second;
  }
  for (int i = 0; i < p; i++) printf("%d ", progTeam[i]);
  printf("\n");
  for (int i = 0; i < sportTeam.size(); i++) printf("%d ", sportTeam[i]);
}
