#include <bits/stdc++.h>
using namespace std;
const int N = 3010;
const int inf = 0x3f3f3f3f;
int dp[N][N];
bool mark[N][N];
vector<tuple<int, int, int>> v;
int n, p, s;
int go(int i, int j) {
  if (j == s) {
    return 0;
  }
  if (i == n) {
    return -inf;
  }
  if (dp[i][j] != -1) {
    return dp[i][j];
  }
  int ans = go(i + 1, j);
  if (i < p + j) {
    int a, b, id;
    tie(a, b, id) = v[i];
    int tmp = b - a + get<0>(v[p + j]) + go(i + 1, j + 1);
    if (tmp > ans) {
      mark[i][j] = true;
      ans = tmp;
    }
  } else if (j < s) {
    int tmp = get<1>(v[i]) + go(i + 1, j + 1);
    if (tmp > ans) {
      mark[i][j] = true;
      ans = tmp;
    }
  }
  return dp[i][j] = ans;
}
int main() {
  ios::sync_with_stdio(false);
  memset(dp, -1, sizeof dp);
  cin >> n >> p >> s;
  v.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> get<0>(v[i]);
    get<2>(v[i]) = 1 + i;
  }
  for (int i = 0; i < n; i++) {
    cin >> get<1>(v[i]);
  }
  sort(v.rbegin(), v.rend());
  int pre = 0;
  for (int i = 0; i < p; i++) {
    pre += get<0>(v[i]);
  }
  cout << pre + go(0, 0) << endl;
  vector<int> ans[2];
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (mark[i][j]) {
      ans[1].emplace_back(get<2>(v[i]));
      j++;
    } else if (ans[0].size() < p) {
      ans[0].emplace_back(get<2>(v[i]));
    }
  }
  sort(begin(ans[0]), end(ans[0]));
  sort(begin(ans[1]), end(ans[1]));
  for (auto x : ans[0]) {
    cout << x << ' ';
  }
  cout << '\n';
  for (auto x : ans[1]) {
    cout << x << ' ';
  }
  cout << '\n';
  return 0;
}
