#include <bits/stdc++.h>
using namespace std;
const int maxn = 4000;
const int maxm = 200000;
const int inf = 0x3f3f3f3f;
struct edge {
  int to, next, cap, cost;
  edge(int _to = 0, int _next = -1, int _cap = 0, int _cost = 0) {
    to = _to, next = _next, cap = _cap, cost = _cost;
  }
} E[maxm];
int head[maxn], si;
int dist[maxn], prevv[maxn], preve[maxn], idx;
pair<int, int> A[maxn];
bool used[maxn];
void add_edge(int u, int v, int c, int w) {
  E[si] = edge(v, head[u], c, w);
  head[u] = si++;
  E[si] = edge(u, head[v], 0, -w);
  head[v] = si++;
}
bool spfa(int s, int t) {
  memset(dist, 0x3f, sizeof(int) * idx);
  memset(used, 0, sizeof(bool) * idx);
  dist[s] = 0;
  used[s] = true;
  queue<int> que;
  que.push(s);
  while (!que.empty()) {
    int v = que.front();
    que.pop();
    used[v] = false;
    for (int i = head[v]; ~i; i = E[i].next) {
      edge &e = E[i];
      if (e.cap > 0 && dist[e.to] > dist[v] + e.cost) {
        dist[e.to] = dist[v] + e.cost;
        prevv[e.to] = v;
        preve[e.to] = i;
        if (!used[e.to]) {
          used[e.to] = true;
          que.push(e.to);
        }
      }
    }
  }
  return dist[t] != inf;
}
int min_cost_flow(int s, int t) {
  int ans = 0;
  while (spfa(s, t)) {
    int f = inf;
    for (int v = t; v != s; v = prevv[v]) {
      int i = preve[v];
      f = min(f, E[i].cap);
    }
    for (int v = t; v != s; v = prevv[v]) {
      int i = preve[v];
      E[i].cap -= f;
      E[i ^ 1].cap += f;
    }
    ans += f * dist[t];
  }
  return ans;
}
int main() {
  int n, p, s;
  while (~scanf("%d%d%d", &n, &p, &s)) {
    memset(head, -1, sizeof head);
    si = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &A[i].first);
      add_edge(0, i, 1, 0);
      add_edge(i, n + 1, 1, -A[i].first);
    }
    for (int i = 1; i <= n; i++) {
      scanf("%d", &A[i].second);
      add_edge(i, n + 2, 1, -A[i].second);
    }
    add_edge(n + 1, n + 3, p, 0);
    add_edge(n + 2, n + 3, s, 0);
    idx = n + 4;
    int ans = min_cost_flow(0, n + 3);
    ans = -ans;
    vector<int> vs[3];
    for (int v = 1; v <= n; v++) {
      for (int i = head[v]; ~i; i = E[i].next) {
        edge e = E[i];
        if (e.to > n && e.cap == 0) {
          vs[e.to - n].push_back(v);
        }
      }
    }
    printf("%d\n", ans);
    for (int i = 1; i < 3; i++) {
      for (auto v : vs[i]) {
        printf("%d ", v);
      }
      printf("\n");
    }
  }
  return 0;
}
