#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, s;
  cin >> n >> p >> s;
  vector<int> psk(n, 0), ssk(n, 0);
  vector<pair<int, int> > mvp;
  for (int i = 0; i < n; i++)
    scanf("%d", &psk[i]), mvp.push_back(pair<int, int>(psk[i], i));
  for (int i = 0; i < n; i++) scanf("%d", &ssk[i]);
  sort(mvp.begin(), mvp.end(), greater<pair<int, int> >());
  vector<vector<int> > dp(n + 1, vector<int>(s + 1, 0)),
      pre(n + 1, vector<int>(s + 1, -1));
  for (int i = 0; i < p; i++) dp[0][0] += mvp[i].first;
  for (int k = 1; k <= n; k++)
    for (int i = 0; i <= min(k, s); i++) {
      if (k > i) {
        dp[k][i] = dp[k - 1][i];
        pre[k][i] = pre[k - 1][i];
      }
      int j = mvp[k - 1].second;
      if (k >= p + i) {
        if (i > 0 && dp[k][i] < dp[k - 1][i - 1] + ssk[j])
          dp[k][i] = dp[k - 1][i - 1] + ssk[j], pre[k][i] = k - 1;
      } else {
        int l = mvp[p + i - 1].second;
        if (i > 0 && dp[k][i] < dp[k - 1][i - 1] + ssk[j] - psk[j] + psk[l])
          dp[k][i] = dp[k - 1][i - 1] + ssk[j] - psk[j] + psk[l],
          pre[k][i] = k - 1;
      }
    }
  cout << dp[n][s] << endl;
  set<int> sSet, pSet;
  int k = n, ss = s;
  while (ss > 0) {
    sSet.insert(mvp[pre[k][ss]].second);
    k = pre[k][ss];
    ss--;
  }
  for (int i = 0, pp = 0; i < n && pp < p; i++)
    if (sSet.find(mvp[i].second) == sSet.end())
      pSet.insert(mvp[i].second), pp++;
  for (auto m : pSet) cout << m + 1 << ' ';
  cout << endl;
  for (auto m : sSet) cout << m + 1 << ' ';
}
