#include <bits/stdc++.h>
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  std::cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <typename T, typename U>
static inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T &x, U y) {
  if (x < y) x = y;
}
std::mt19937_64 rng(
    std::chrono::steady_clock::now().time_since_epoch().count());
using namespace std;
template <typename flow_t = long long, typename cost_t = long long>
struct mcSFlow {
  struct Edge {
    cost_t c;
    flow_t f;
    long long to, rev;
    Edge(long long _to, cost_t _c, flow_t _f, long long _rev)
        : c(_c), f(_f), to(_to), rev(_rev) {}
  };
  static constexpr cost_t INFCOST = numeric_limits<cost_t>::max() / 2;
  cost_t eps;
  long long N, S, T;
  vector<vector<Edge> > G;
  vector<unsigned long long> isq, cur;
  vector<flow_t> ex;
  vector<cost_t> h;
  mcSFlow(long long _N, long long _S, long long _T)
      : eps(0), N(_N), S(_S), T(_T), G(_N) {}
  void add_edge(long long a, long long b, cost_t cost, flow_t cap) {
    if (a == b) {
      return;
    }
    cost *= N;
    eps = max(eps, abs(cost));
    G[a].emplace_back(b, cost, cap, G[b].size());
    G[b].emplace_back(a, -cost, 0, G[a].size() - 1);
  }
  void add_flow(Edge &e, flow_t f) {
    Edge &back = G[e.to][e.rev];
    if (!ex[e.to] && f) hs[h[e.to]].push_back(e.to);
    e.f -= f;
    ex[e.to] += f;
    back.f += f;
    ex[back.to] -= f;
  }
  vector<vector<long long> > hs;
  vector<long long> co;
  flow_t max_flow() {
    ex.assign(N, 0);
    h.assign(N, 0);
    hs.resize(2 * N);
    co.assign(2 * N, 0);
    cur.assign(N, 0);
    h[S] = N;
    ex[T] = 1;
    co[0] = N - 1;
    for (auto &e : G[S]) add_flow(e, e.f);
    if (hs[0].size())
      for (long long hi = 0; hi >= 0;) {
        long long u = hs[hi].back();
        hs[hi].pop_back();
        while (ex[u] > 0) {
          if (cur[u] == G[u].size()) {
            h[u] = 1e9;
            for (unsigned long long i = 0; i < G[u].size(); ++i) {
              auto &e = G[u][i];
              if (e.f && h[u] > h[e.to] + 1) {
                h[u] = h[e.to] + 1, cur[u] = i;
              }
            }
            if (++co[h[u]], !--co[hi] && hi < N)
              for (long long i = 0; i < N; ++i)
                if (hi < h[i] && h[i] < N) {
                  --co[h[i]];
                  h[i] = N + 1;
                }
            hi = h[u];
          } else if (G[u][cur[u]].f && h[u] == h[G[u][cur[u]].to] + 1)
            add_flow(G[u][cur[u]], min(ex[u], G[u][cur[u]].f));
          else
            ++cur[u];
        }
        while (hi >= 0 && hs[hi].empty()) --hi;
      }
    return -ex[S];
  }
  void push(Edge &e, flow_t amt) {
    if (e.f < amt) amt = e.f;
    e.f -= amt;
    ex[e.to] += amt;
    G[e.to][e.rev].f += amt;
    ex[G[e.to][e.rev].to] -= amt;
  }
  void relabel(long long vertex) {
    cost_t newHeight = -INFCOST;
    for (unsigned long long i = 0; i < G[vertex].size(); ++i) {
      Edge const &e = G[vertex][i];
      if (e.f && newHeight < h[e.to] - e.c) {
        newHeight = h[e.to] - e.c;
        cur[vertex] = i;
      }
    }
    h[vertex] = newHeight - eps;
  }
  static constexpr long long scale = 2;
  pair<flow_t, cost_t> minCostMaxFlow() {
    cost_t retCost = 0;
    for (long long i = 0; i < N; ++i)
      for (Edge &e : G[i]) retCost += e.c * (e.f);
    flow_t retFlow = max_flow();
    h.assign(N, 0);
    ex.assign(N, 0);
    isq.assign(N, 0);
    cur.assign(N, 0);
    queue<long long> q;
    for (; eps; eps >>= scale) {
      fill(cur.begin(), cur.end(), 0);
      for (long long i = 0; i < N; ++i)
        for (auto &e : G[i])
          if (h[i] + e.c - h[e.to] < 0 && e.f) push(e, e.f);
      for (long long i = 0; i < N; ++i) {
        if (ex[i] > 0) {
          q.push(i);
          isq[i] = 1;
        }
      }
      while (!q.empty()) {
        long long u = q.front();
        q.pop();
        isq[u] = 0;
        while (ex[u] > 0) {
          if (cur[u] == G[u].size()) relabel(u);
          for (unsigned long long &i = cur[u], max_i = G[u].size(); i < max_i;
               ++i) {
            Edge &e = G[u][i];
            if (h[u] + e.c - h[e.to] < 0) {
              push(e, ex[u]);
              if (ex[e.to] > 0 && isq[e.to] == 0) {
                q.push(e.to);
                isq[e.to] = 1;
              }
              if (ex[u] == 0) break;
            }
          }
        }
      }
      if (eps > 1 && eps >> scale == 0) {
        eps = 1 << scale;
      }
    }
    for (long long i = 0; i < N; ++i) {
      for (Edge &e : G[i]) {
        retCost -= e.c * (e.f);
      }
    }
    return make_pair(retFlow, retCost / 2 / N);
  }
  flow_t getFlow(Edge const &e) { return G[e.to][e.rev].f; }
};
void meowmeow321() {
  long long n, p, sp;
  cin >> n >> p >> sp;
  long long a[n];
  long long b[n];
  for (long long xxx = 0; xxx < n; ++xxx) cin >> a[xxx];
  for (long long xxx = 0; xxx < n; ++xxx) cin >> b[xxx];
  long long prog = n;
  long long sports = n + 1;
  long long s = n + 2;
  long long t = n + 3;
  mcSFlow<> dog(n + 4, s, t);
  for (long long i = 0; i < n; ++i) {
    dog.add_edge(s, i, 0, 1);
    dog.add_edge(i, prog, -a[i], 1);
    dog.add_edge(i, sports, -b[i], 1);
  }
  dog.add_edge(prog, t, 0, p);
  dog.add_edge(sports, t, 0, sp);
  long long sup = -dog.minCostMaxFlow().second;
  cout << sup << "\n";
  vector<long long> pp, qq;
  for (long long i = 0; i < n; ++i) {
    for (auto u : dog.G[i]) {
      if (u.f == 0) {
        if (u.to == prog)
          pp.push_back(i + 1);
        else if (u.to == sports)
          qq.push_back(i + 1);
      }
    }
  }
  for (auto &a : pp) cout << a << " ";
  cout << "\n";
  for (auto &a : qq) cout << a << " ";
  cout << "\n";
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long testcases = 1;
  for (long long i = 0; i < testcases; ++i) {
    meowmeow321();
  }
  return 0;
}
