#include <bits/stdc++.h>
using namespace std;
const long long nmax = 3006;
int n, s, p, f[nmax][nmax];
pair<pair<int, int>, int> a[nmax];
vector<int> S, P;
int tinh(int i, int j) {
  if (i == n) return (j == s ? 0 : -1000000000);
  if (f[i][j]) return f[i][j];
  return f[i][j] = max(tinh(i + 1, j + 1) + a[i].first.second,
                       tinh(i + 1, j) + (i - j < p) * a[i].first.first);
}
void lankq(int i, int j) {
  if (i == n) return;
  if (tinh(i, j) == tinh(i + 1, j + 1) + a[i].first.second) {
    S.push_back(a[i].second);
    lankq(i + 1, j + 1);
    return;
  }
  if (i - j < p) P.push_back(a[i].second);
  lankq(i + 1, j);
}
int main() {
  cin >> n >> p >> s;
  for (int i = 0; i < n; i++) cin >> a[i].first.first;
  for (int i = 0; i < n; i++) cin >> a[i].first.second, a[i].second = i;
  sort(a, a + n);
  reverse(a, a + n);
  cout << tinh(0, 0) << endl;
  lankq(0, 0);
  for (auto &x : P) cout << x + 1 << " ";
  cout << endl;
  for (auto &x : S) cout << x + 1 << " ";
}
