#include <bits/stdc++.h>
using namespace std;
int D[3005], P, S, N;
int A[3005], B[3005];
int Dp[3005][3005];
int sol[3005];
bool comp(const int s1, const int s2) { return B[s1] - A[s1] < B[s2] - A[s2]; }
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  scanf("%d%d%d", &N, &P, &S);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &B[i]);
    D[i] = i;
  }
  sort(D + 1, D + 1 + N, comp);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= min(i, P + S); j++)
      Dp[i][j] =
          max(Dp[i - 1][j], Dp[i - 1][j - 1] + ((j > P) ? B[D[i]] : A[D[i]]));
  printf("%d\n", Dp[N][P + S]);
  int p = N, k = P + S;
  while (k) {
    if (Dp[p][k] == Dp[p - 1][k]) {
      p--;
      continue;
    }
    sol[k] = D[p];
    p--, k--;
  }
  for (int i = 1; i <= P; i++) printf("%d ", sol[i]);
  printf("\n");
  for (int i = 1; i <= S; i++) printf("%d ", sol[P + i]);
  return 0;
}
