#include <bits/stdc++.h>
using namespace std;
const int N = 3030;
struct T {
  int first, second;
  int id;
} a[N];
int dp[N][N];
int trace[N][N];
int n, p, s;
bool maximize(int &a, int b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
bool dec_second(T a, T b) { return a.second > b.second; }
int main() {
  cin >> n >> p >> s;
  for (int i = 1; i <= n; ++i) a[i].id = i;
  for (int i = 1; i <= n; ++i) cin >> a[i].first;
  for (int i = 1; i <= n; ++i) cin >> a[i].second;
  sort(a + 1, a + 1 + n, dec_second);
  memset(dp, -1, sizeof dp);
  dp[0][0] = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= i; ++j)
      if (dp[i][j] >= 0) {
        int k = (j + s <= i) ? s : (i - j);
        if (j < p) {
          if (maximize(dp[i + 1][j + 1], dp[i][j] + a[i + 1].first)) {
            trace[i + 1][j + 1] = 1;
          }
        }
        if (maximize(dp[i + 1][j], dp[i][j] + (k < s ? a[i + 1].second : 0))) {
          if (k < s)
            trace[i + 1][j] = 2;
          else
            trace[i + 1][j] = 3;
        }
      }
  }
  cout << dp[n][p] << endl;
  vector<int> x, y;
  for (int i = n, j = p; i > 0; --i) {
    assert(trace[i][j] != 0);
    if (trace[i][j] == 1) {
      j -= 1;
      x.push_back(a[i].id);
    } else {
      if (trace[i][j] == 2) y.push_back(a[i].id);
    }
  }
  for (int v : x) cout << v << ' ';
  cout << endl;
  for (int v : y) cout << v << ' ';
  cout << endl;
  return 0;
}
