#include <bits/stdc++.h>
using namespace std;
struct st {
  int x, y, id;
  bool operator<(const st &pt) const {
    if (x == pt.x) return y < pt.y;
    return x > pt.x;
  }
} a[3003];
int p, s, n;
int hari(int m) {
  vector<int> tmp;
  int ret = 0;
  for (int i = 0; i < m; i++) {
    ret += a[i].x;
    tmp.push_back(a[i].y - a[i].x);
  }
  sort(tmp.begin(), tmp.end());
  reverse(tmp.begin(), tmp.end());
  for (int i = 0; i < m - p; i++) {
    ret += tmp[i];
  }
  tmp.clear();
  for (int i = m; i < n; i++) {
    tmp.push_back(a[i].y);
  }
  sort(tmp.begin(), tmp.end());
  reverse(tmp.begin(), tmp.end());
  for (int i = 0; i < s - (m - p); i++) {
    ret += tmp[i];
  }
  return ret;
}
void moni(int m) {
  vector<int> hr, mk;
  vector<pair<int, int> > tmp;
  for (int i = 0; i < m; i++) {
    tmp.push_back({(a[i].y - a[i].x), a[i].id});
  }
  sort(tmp.begin(), tmp.end());
  reverse(tmp.begin(), tmp.end());
  map<int, int> mp;
  for (int i = 0; i < m - p; i++) {
    mk.push_back(tmp[i].second);
    mp[tmp[i].second] = 1;
  }
  for (int i = 0; i < m; i++) {
    if (mp[tmp[i].second] == 0) hr.push_back(tmp[i].second);
  }
  tmp.clear();
  for (int i = m; i < n; i++) {
    tmp.push_back({a[i].y, a[i].id});
  }
  sort(tmp.begin(), tmp.end());
  reverse(tmp.begin(), tmp.end());
  for (int i = 0; i < s - (m - p); i++) {
    mk.push_back(tmp[i].second);
  }
  for (int i = 0; i < (int)hr.size(); i++) {
    cout << hr[i] << " ";
  }
  cout << endl;
  for (int i = 0; i < (int)mk.size(); i++) {
    cout << mk[i] << " ";
  }
  cout << endl;
  return;
}
int main() {
  cin >> n >> p >> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i].x;
    a[i].id = i + 1;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i].y;
  }
  sort(a, a + n);
  int Ans = 0, idx;
  for (int i = p; i <= s + p; i++) {
    int ret = hari(i);
    if (ret > Ans) {
      Ans = ret;
      idx = i;
    }
  }
  cout << Ans << endl;
  moni(idx);
  return 0;
}
