#include <bits/stdc++.h>
using namespace std;
int n, p, s, A[3010], B[3010];
vector<pair<int, int> > df;
long long dp[3010][3010], bk[3010][3010];
long long fun(int a, int b) {
  if (b > s) return -1e18;
  if (a == n) {
    if (b == s) return 0;
    return -1e18;
  }
  if (dp[a][b] != -1) return dp[a][b];
  long long m1 = df[a].second + fun(a + 1, b + 1);
  if (a - b < p) {
    long long m2 = df[a].first + fun(a + 1, b);
    if (m2 > m1) {
      bk[a][b] = 2;
      return dp[a][b] = m2;
    } else {
      bk[a][b] = 1;
      return dp[a][b] = m1;
    }
  } else {
    long long m2 = fun(a + 1, b);
    if (m2 > m1) {
      bk[a][b] = 0;
      return dp[a][b] = m2;
    } else {
      bk[a][b] = 1;
      return dp[a][b] = m1;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> p >> s;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) cin >> B[i];
  vector<pair<pair<int, int>, int> > ry;
  for (int i = 0; i < n; i++) {
    df.push_back(make_pair(A[i], B[i]));
    ry.push_back(make_pair(make_pair(A[i], B[i]), i));
  }
  sort(df.begin(), df.end());
  sort(ry.begin(), ry.end());
  reverse(df.begin(), df.end());
  reverse(ry.begin(), ry.end());
  memset(dp, -1, sizeof(dp));
  cout << fun(0, 0) << '\n';
  int a = 0, b = 0;
  vector<int> v1, v2;
  while (a != n) {
    if (bk[a][b] == 0) {
      a++;
    } else if (bk[a][b] == 1) {
      v2.push_back(a);
      a++;
      b++;
    } else {
      v1.push_back(a);
      a++;
    }
  }
  for (int i = 0; i < v1.size(); i++) cout << ry[v1[i]].second + 1 << " ";
  cout << '\n';
  for (int i = 0; i < v2.size(); i++) cout << ry[v2[i]].second + 1 << " ";
  cout << '\n';
}
