#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3fffffff;
struct Edge {
  int dest, flow, cost, ctpt;
  Edge() {}
  Edge(int _dest, int _flow, int _cost, int _ctpt)
      : dest(_dest), flow(_flow), cost(_cost), ctpt(_ctpt) {}
};
vector<Edge> edge[3004];
int source = 3000, sink = 3001, dist[3004], from[3004];
vector<Edge>::iterator efrom[3004];
bool inq[3004];
queue<int> q;
inline void addEdge(int from, int to, int flow, int cost) {
  int sf = edge[from].size(), st = edge[to].size();
  edge[from].emplace_back(to, flow, cost, st);
  edge[to].emplace_back(from, 0, -cost, sf);
}
bool augmentable() {
  vector<Edge>::iterator i;
  int x;
  memset(dist, -1, sizeof(dist));
  dist[source] = 0;
  inq[source] = true;
  q.push(source);
  while (!q.empty()) {
    inq[x = q.front()] = false;
    q.pop();
    for (i = edge[x].begin(); i != edge[x].end(); ++i)
      if (i->flow &&
          (dist[i->dest] == -1 || dist[i->dest] < dist[x] + i->cost)) {
        dist[i->dest] = dist[x] + i->cost;
        from[i->dest] = x;
        efrom[i->dest] = i;
        if (!inq[i->dest]) {
          inq[i->dest] = true;
          q.push(i->dest);
        }
      }
  }
  return dist[sink] != -1;
}
int augment() {
  int i, flow = inf, cost = 0;
  for (i = sink; i != source; i = from[i]) flow = min(flow, efrom[i]->flow);
  for (i = sink; i != source; i = from[i]) {
    cost += efrom[i]->cost;
    efrom[i]->flow -= flow;
    edge[i][efrom[i]->ctpt].flow += flow;
  }
  return cost * flow;
}
int main() {
  int n, p, s, x, i, ans = 0;
  vector<Edge>::iterator it;
  scanf("%d%d%d", &n, &p, &s);
  for (i = 0; i < n; ++i) {
    scanf("%d", &x);
    addEdge(i, 3002, 1, x);
  }
  for (i = 0; i < n; ++i) {
    scanf("%d", &x);
    addEdge(i, 3003, 1, x);
  }
  for (i = 0; i < n; ++i) addEdge(source, i, 1, 0);
  addEdge(3002, sink, p, 0);
  addEdge(3003, sink, s, 0);
  while (augmentable()) ans += augment();
  printf("%d\n", ans);
  for (it = edge[3002].begin(); it != edge[3002].end(); ++it)
    if (it->dest < n && it->flow) printf("%d ", it->dest + 1);
  puts("");
  for (it = edge[3003].begin(); it != edge[3003].end(); ++it)
    if (it->dest < n && it->flow) printf("%d ", it->dest + 1);
  puts("");
  return 0;
}
