#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, int> > p1, p2, p12;
int n, s1, s2;
int num1[3005];
int num2[3005];
bool vis[3005];
int ans1[3005];
int ans2[3005];
int main() {
  cin >> n >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    scanf("%d", &num1[i]);
    p1.push(make_pair(num1[i], i));
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &num2[i]);
    p2.push(make_pair(num2[i], i));
  }
  long long ans = 0;
  for (int i = 0; i < s1; i++) {
    pair<int, int> u;
    u = p1.top();
    p1.pop();
    vis[u.second] = true;
    ans1[i] = u.second;
    ans += u.first;
    p12.push(make_pair(num2[u.second] - num1[u.second], i));
  }
  for (int i = 0; i < s2; i++) {
    pair<int, int> u, v, w;
    while (!p1.empty() && vis[p1.top().second]) p1.pop();
    while (!p2.empty() && vis[p2.top().second]) p2.pop();
    if (!p1.empty()) u = p1.top();
    if (!p2.empty()) v = p2.top();
    w = p12.top();
    if (p2.empty() || u.first + w.first > v.first) {
      ans2[i] = ans1[w.second];
      ans1[w.second] = u.second;
      vis[u.second] = true;
      ans += u.first + w.first;
      p1.pop();
      int idx = u.second;
      p12.push(make_pair(num2[idx] - num1[idx], w.second));
      p12.pop();
    } else {
      ans += v.first;
      ans2[i] = v.second;
      vis[v.second] = true;
      p2.pop();
    }
  }
  cout << ans << endl;
  for (int i = 0; i < s1; i++) {
    cout << ans1[i] + 1 << " ";
  }
  cout << endl;
  for (int i = 0; i < s2; i++) {
    cout << ans2[i] + 1 << " ";
  }
}
