#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;
}

### Prompt

Please create a solution in cpp to the following problem:

There are n students at Berland State University. Every student has two skills, each measured as a number: ai — the programming skill and bi — the sports skill.

It is announced that an Olympiad in programming and sports will be held soon. That's why Berland State University should choose two teams: one to take part in the programming track and one to take part in the sports track.

There should be exactly p students in the programming team and exactly s students in the sports team. A student can't be a member of both teams.

The university management considers that the strength of the university on the Olympiad is equal to the sum of two values: the programming team strength and the sports team strength. The strength of a team is the sum of skills of its members in the corresponding area, so the strength of the programming team is the sum of all ai and the strength of the sports team is the sum of all bi over corresponding team members.

Help Berland State University to compose two teams to maximize the total strength of the university on the Olympiad.

Input

The first line contains three positive integer numbers n, p and s (2 ≤ n ≤ 3000, p + s ≤ n) — the number of students, the size of the programming team and the size of the sports team.

The second line contains n positive integers a1, a2, ..., an (1 ≤ ai ≤ 3000), where ai is the programming skill of the i-th student.

The third line contains n positive integers b1, b2, ..., bn (1 ≤ bi ≤ 3000), where bi is the sports skill of the i-th student.

Output

In the first line, print the the maximum strength of the university on the Olympiad. In the second line, print p numbers — the members of the programming team. In the third line, print s numbers — the members of the sports team.

The students are numbered from 1 to n as they are given in the input. All numbers printed in the second and in the third lines should be distinct and can be printed in arbitrary order.

If there are multiple solutions, print any of them.

Examples

Input

5 2 2
1 3 4 5 2
5 3 2 1 4


Output

18
3 4 
1 5 


Input

4 2 2
10 8 8 3
10 7 9 4


Output

31
1 2 
3 4 


Input

5 3 1
5 2 5 1 7
6 3 1 6 3


Output

23
1 3 5 
4 

### Response

```cpp
#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;
}

```