#include <bits/stdc++.h>
using namespace std;
const int max_N = 3000 + 10;
pair<int, pair<int, int> > t[max_N];
int dp[max_N][max_N], par[max_N][max_N], x[max_N];
bool cmp(pair<int, pair<int, int> > a, pair<int, pair<int, int> > b) {
  return (a.first > b.first);
}
void pp(int i, int j) {
  if (!i || j < 0) return;
  if (par[i][j] == 1) {
    x[t[i - 1].second.second] = 1;
    pp(i - 1, j - 1);
  } else if (par[i][j] == 2) {
    x[t[i - 1].second.second] = 2;
    pp(i - 1, j);
  } else
    pp(i - 1, j);
}
int main() {
  ios::sync_with_stdio(false);
  int n, p, s, a, b;
  cin >> n >> p >> s;
  for (int i = 0; i < n; i++) cin >> t[i].second.first;
  for (int i = 0; i < n; i++) {
    cin >> t[i].first;
    t[i].second.second = i;
  }
  sort(t, t + n, cmp);
  dp[0][0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= min(p, i + 1); j++) {
      int tmp1 = (j) ? dp[i][j - 1] + t[i].second.first : 0;
      int tmp2 = (i >= j) ? dp[i][j] : 0;
      if (i >= j && i - j < s) tmp2 += t[i].first, par[i + 1][j] = 2;
      if (tmp1 > tmp2)
        dp[i + 1][j] = tmp1, par[i + 1][j] = 1;
      else
        dp[i + 1][j] = tmp2;
    }
  }
  cout << dp[n][p] << endl;
  pp(n, p);
  for (int i = 0; i < n; i++)
    if (x[i] == 1) cout << i + 1 << ' ';
  cout << endl;
  for (int i = 0; i < n; i++)
    if (x[i] == 2) cout << i + 1 << ' ';
  cout << endl;
  return 0;
}
