#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
int dp[N][N];
int n, s, p;
pair<pair<int, int>, int> arr[N];
vector<int> sp;
vector<int> pr;
int solve(int idx, int sport) {
  int program = n - 1 - idx - sport;
  program = min(program, p);
  if (sport == s && program == p) return 0;
  if (idx == -1) return -1e9;
  int &ret = dp[idx][sport];
  if (ret != -1) return ret;
  ret = -1e9;
  if (program == p) ret = max(ret, solve(idx - 1, sport));
  if (sport < s)
    ret = max(ret, solve(idx - 1, sport + 1) + arr[idx].first.second);
  if (program < p) ret = max(ret, solve(idx - 1, sport) + arr[idx].first.first);
  return ret;
}
void backtrack(int idx, int sport) {
  int program = n - 1 - idx - sport;
  program = min(program, p);
  if (sport == s && program == p) return;
  int ret = solve(idx, sport);
  if (program == p && ret == solve(idx - 1, sport)) {
    backtrack(idx - 1, sport);
  } else if (sport < s &&
             ret == solve(idx - 1, sport + 1) + arr[idx].first.second) {
    sp.push_back(arr[idx].second + 1);
    backtrack(idx - 1, sport + 1);
  } else {
    pr.push_back(arr[idx].second + 1);
    backtrack(idx - 1, sport);
  }
}
int main() {
  cin >> n >> p >> s;
  for (int i = 0; i < n; i++) cin >> arr[i].first.first;
  for (int i = 0; i < n; i++) cin >> arr[i].first.second;
  for (int i = 0; i < n; i++) arr[i].second = i;
  sort(arr, arr + n);
  memset(dp, -1, sizeof dp);
  cout << solve(n - 1, 0) << endl;
  backtrack(n - 1, 0);
  for (int x : pr) cout << x << " ";
  cout << endl;
  for (int x : sp) cout << x << " ";
  cout << endl;
  return 0;
}
