#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
struct Edge {
  int x, c, w, nxt;
  Edge() {}
  Edge(int x, int c, int w, int nxt) : x(x), c(c), w(w), nxt(nxt) {}
} edge[100010];
int head[3010], dis[3010], pre[3010], pree[3010];
bool inque[3010], vis[3010];
int n, n1, n2, e, src, sink;
void addedge(int x, int y, int c, int w) {
  edge[e] = Edge(y, c, w, head[x]);
  head[x] = e++;
  edge[e] = Edge(x, 0, -w, head[y]);
  head[y] = e++;
}
bool spfa() {
  int x, y, w;
  queue<int> que;
  memset(dis, 0x3f, sizeof(dis));
  memset(inque, 0, sizeof(inque));
  que.push(src);
  dis[src] = 0;
  inque[src] = true;
  while (!que.empty()) {
    x = que.front();
    que.pop();
    inque[x] = false;
    for (int i = head[x]; i != -1; i = edge[i].nxt) {
      y = edge[i].x;
      w = edge[i].w;
      if (edge[i].c > 0 && dis[x] + w < dis[y]) {
        dis[y] = dis[x] + w;
        pre[y] = x;
        pree[y] = i;
        if (!inque[y] && y != sink) {
          que.push(y);
          inque[y] = true;
        }
      }
    }
  }
  return dis[sink] < inf;
}
int mincostflow() {
  int ans = 0, minc, x, d;
  while (spfa()) {
    minc = inf;
    x = sink;
    while (x != src) {
      minc = min(minc, edge[pree[x]].c);
      x = pre[x];
    }
    x = sink;
    while (x != src) {
      edge[pree[x]].c -= minc;
      edge[pree[x] ^ 1].c += minc;
      x = pre[x];
    }
    ans += minc * dis[sink];
  }
  return ans;
}
void doing(int x) {
  memset(vis, 0, sizeof(vis));
  for (int i = head[x]; i != -1; i = edge[i].nxt)
    if ((i & 1) == 0 && edge[i].c) vis[edge[i].x] = true;
}
int main() {
  scanf("%d%d%d", &n, &n1, &n2);
  e = 0;
  memset(head, -1, sizeof(head));
  src = 0;
  sink = n + 1;
  int p1 = n + 2, p2 = n + 3;
  addedge(src, p1, n1, 0);
  addedge(src, p2, n2, 0);
  int z;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &z);
    addedge(p1, i, 1, -z);
    addedge(i, sink, 1, 0);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &z);
    addedge(p2, i, 1, -z);
  }
  int ans = -mincostflow();
  printf("%d\n", ans);
  doing(p1);
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) printf("%d ", i);
  printf("\n");
  doing(p2);
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) printf("%d ", i);
  printf("\n");
  return 0;
}
