#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 5;
pair<pair<int, int>, int> in[N];
int dp[N][N], par[N][N];
int main() {
  int n, p, s, i, j, first, second, u, v, ind;
  cin >> n >> p >> s;
  for (i = 0; i < n; ++i) scanf("%d", &in[i].first.first);
  for (i = 0; i < n; ++i)
    scanf("%d", &in[i].first.second), in[i].second = i + 1;
  sort(in, in + n, greater<pair<pair<int, int>, int> >());
  for (i = 0; i < n; ++i) {
    first = in[i].first.first;
    second = in[i].first.second;
    for (j = 0; j <= i; ++j) {
      u = i - j;
      v = 0;
      if (u < p) v = first;
      if (dp[i + 1][j] < dp[i][j] + v)
        dp[i + 1][j] = dp[i][j] + v, par[i + 1][j] = 0;
      if (dp[i + 1][j + 1] < dp[i][j] + second) {
        dp[i + 1][j + 1] = dp[i][j] + second, par[i + 1][j + 1] = 1;
      }
    }
  }
  cout << dp[n][s] << endl;
  i = n, j = s;
  vector<int> r1, r2;
  while (i > 0) {
    u = par[i][j];
    first = in[i - 1].first.first, second = in[i - 1].first.second;
    ind = in[i - 1].second;
    if (u) {
      r2.push_back(ind);
      --j;
    } else {
      if (i - 1 - j < p) r1.push_back(ind);
    }
    --i;
  }
  for (i = 0; i < r1.size(); ++i) printf("%d ", r1[i]);
  cout << endl;
  for (i = 0; i < r2.size(); ++i) printf("%d ", r2[i]);
  cout << endl;
}
