#include <bits/stdc++.h>
using namespace std;
const int N = 5010;
struct Edge {
  int v, u, f, r, c;
  Edge() {}
  Edge(int v, int u, int f, int c, int r) : v(v), u(u), f(f), c(c), r(r) {}
};
const int inf = 1e9;
const int C = 4000;
int n, m, k, nflow, s, t, parent[N], number[N], a[N], b[N];
int dist[N], pl[N];
vector<Edge> g[N];
queue<pair<int, int> > q;
vector<int> ga, gb;
void addEdge(int a, int b, int u, int c) {
  g[a].push_back(Edge(b, u, 0, c, g[b].size()));
  g[b].push_back(Edge(a, 0, 0, -c, g[a].size() - 1));
}
int MinCostFlow() {
  int flow = 0;
  int cost = 0;
  while (true) {
    for (int i = 1; i <= nflow; i++) dist[i] = inf;
    dist[s] = 0;
    q.push(make_pair(0, s));
    while (!q.empty()) {
      int v = (q.front()).second;
      int d = -(q.front()).first;
      q.pop();
      if (dist[v] != d) continue;
      if (d == inf) break;
      for (int i = 0; i < g[v].size(); i++)
        if (g[v][i].f < g[v][i].u && dist[g[v][i].v] > d + g[v][i].c) {
          dist[g[v][i].v] = d + g[v][i].c;
          q.push(make_pair(-dist[g[v][i].v], g[v][i].v));
          number[g[v][i].v] = i;
          parent[g[v][i].v] = v;
        }
    }
    if (dist[t] == inf) break;
    int v = t, addflow = 1e9;
    while (v != s) {
      int u = parent[v];
      addflow = min(addflow, g[u][number[v]].u - g[u][number[v]].f);
      v = u;
    }
    v = t;
    while (v != s) {
      int u = parent[v];
      cost += addflow * g[u][number[v]].c;
      g[u][number[v]].f += addflow;
      g[v][g[u][number[v]].r].f -= addflow;
      v = u;
    }
    flow += addflow;
  }
  return cost;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  s = n + 3;
  t = n + 4;
  for (int i = 1; i <= n; i++) {
    addEdge(n + 1, i, 1, -a[i]);
    addEdge(n + 2, i, 1, -b[i]);
  }
  addEdge(s, n + 1, m, 0);
  addEdge(s, n + 2, k, 0);
  for (int i = 1; i <= n; i++) {
    addEdge(i, t, 1, 0);
  }
  nflow = n + 4;
  int ans = -MinCostFlow();
  cout << ans << endl;
  for (int j = 0; j < g[n + 1].size(); j++) {
    int v = g[n + 1][j].v;
    if (v >= 1 && v <= n && g[n + 1][j].f == 1) {
      ga.push_back(v);
    }
  }
  for (int j = 0; j < g[n + 2].size(); j++) {
    int v = g[n + 2][j].v;
    if (v >= 1 && v <= n && g[n + 2][j].f == 1) {
      gb.push_back(v);
    }
  }
  for (int i = 0; i < ga.size(); i++) cout << ga[i] << " ";
  cout << endl;
  for (int i = 0; i < gb.size(); i++) cout << gb[i] << " ";
  cout << endl;
  return 0;
}
