#include <bits/stdc++.h>
using namespace std;
template <typename T>
T In() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
template <class T, class first>
inline bool checkbit(T a, first pos) {
  T t = 1;
  return ((a & (t << pos)) > 0);
}
template <class T, class first>
inline T setbit(T a, first pos) {
  T t = 1;
  return (a | (t << pos));
}
template <class T, class first>
inline T resetbit(T a, first pos) {
  T t = 1;
  return (a & (~(t << pos)));
}
template <class T, class first>
inline T togglebit(T a, first pos) {
  T t = 1;
  return (a ^ (t << pos));
}
template <typename T>
T POW(T base, T power) {
  T ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base);
    base = (base * base);
    power >>= 1;
  }
  return ret;
}
template <typename T>
T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (b == 0) ? a : GCD(b, a % b);
}
template <typename T>
T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return a * (b / GCD(a, b));
}
template <typename T>
T EUCLIDE(T a, T b, T &x, T &y) {
  if (a < 0) {
    T d = euclide(-a, b, x, y);
    x = -x;
    return d;
  }
  if (b < 0) {
    T d = euclide(a, -b, x, y);
    y = -y;
    return d;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    T d = euclide(b, a % b, x, y);
    T t = x;
    x = y;
    y = t - (a / b) * y;
    return d;
  }
}
template <typename T>
T ABS(T a) {
  if (a < 0)
    return -a;
  else
    return a;
}
long long Bigmod(long long base, long long power, long long _MOD) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % _MOD;
    base = (base * base) % _MOD;
    power >>= 1;
  }
  return ret;
}
long long ModInverse(long long number, long long _MOD) {
  return Bigmod(number, _MOD - 2LL, _MOD);
}
template <typename T>
double DIS(T x1, T y1, T x2, T y2) {
  return sqrt((double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
}
template <typename T>
T ANGLE(T x1, T y1, T x2, T y2) {
  return atan(double(y1 - y2) / double(x1 - x2));
}
template <typename T>
long long isLeft(T a, T b, T c) {
  return (c.x - a.x) * (b.y - a.y) - (b.x - a.x) * (c.y - a.y);
}
const double PI = 2 * acos(0);
double DEG(double x) { return (180.0 * x) / (PI * 1.0); }
double RAD(double x) { return (x * (PI * 1.0)) / (180.0); }
void P_ARR(int *ar, int a, int b) {
  if (a > b) swap(a, b);
  if (a <= b) cout << ar[a];
  for (int i = a + 1; i <= b; i++) cout << " " << ar[i];
  cout << endl;
}
template <class T>
inline void make_unique_vec(vector<T> &vec) {
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
template <class T>
inline void make_unique_arr(T *ar, int &n) {
  sort(ar + 1, ar + n + 1);
  n = unique(ar + 1, ar + n + 1) - ar - 1;
}
struct MinCostMaxFlow {
  struct node {
    int from, to, next, cap;
    int cst;
  } edge[300007];
  int head[6007];
  int q[6007], front, rear, avail, vn;
  int in[6007], pre[6007];
  int cost[6007];
  bool vis[6007];
  void init(int maxnode) {
    avail = 0;
    vn = maxnode;
    memset(head, -1, sizeof(head));
  }
  void insert(int from, int to, int cap, int cst) {
    edge[avail].from = from;
    edge[avail].to = to;
    edge[avail].cap = cap;
    edge[avail].cst = cst;
    edge[avail].next = head[from];
    head[from] = avail++;
    edge[avail].from = to;
    edge[avail].to = from;
    edge[avail].cap = 0;
    edge[avail].cst = -cst;
    edge[avail].next = head[to];
    head[to] = avail++;
  }
  bool spfa(int src, int des) {
    for (int i = 0; i <= vn; i++) cost[i] = INT_MAX;
    memset(vis, 0, sizeof(vis));
    memset(in, 0, sizeof(in));
    cost[src] = 0;
    pre[src] = -1;
    front = 0, rear = 1;
    q[front] = src;
    vis[src] = true;
    in[src]++;
    while (front != rear) {
      int u = q[front++], v;
      front %= 6007;
      vis[u] = false;
      for (int i = head[u]; i != -1; i = edge[i].next) {
        v = edge[i].to;
        if (edge[i].cap > 0 && cost[v] > cost[u] + edge[i].cst) {
          cost[v] = cost[u] + edge[i].cst;
          pre[v] = i;
          if (!vis[v]) {
            q[rear++] = v;
            rear %= 6007;
            vis[v] = true;
            in[v]++;
            if (in[v] > vn) return false;
          }
        }
      }
    }
    if (cost[des] < INT_MAX)
      return true;
    else
      return false;
  }
  pair<long long, long long> mincostmaxflow(int src, int des) {
    long long mincost = 0, maxflow = 0;
    int i, j;
    while (spfa(src, des)) {
      int flow = INT_MAX;
      for (i = pre[des]; i != -1; i = pre[edge[i].from]) {
        flow = min(flow, edge[i].cap);
      }
      maxflow += flow;
      for (i = pre[des]; i != -1; i = pre[edge[i].from]) {
        edge[i].cap -= flow;
        edge[i ^ 1].cap += flow;
      }
      mincost += ((long long)cost[des] * (long long)flow);
    }
    return make_pair(mincost, maxflow);
  }
  void print(int src, int n) {
    int u = src, v;
    int flag = 0;
    for (int i = head[u]; i != -1; i = edge[i].next) {
      int v = edge[i].to;
      int cst = edge[i].cst;
      int cap = edge[i].cap;
      if (cap == 1 && v >= n + 1 && v <= n + n) {
        if (flag) printf(" ");
        flag = 1;
        printf("%d", v - n);
      }
    }
    puts("");
    ;
  }
} MCMF;
int ar[100007];
int br[100007];
int main() {
  int n;
  scanf("%d", &(n));
  ;
  int p;
  scanf("%d", &(p));
  ;
  int s;
  scanf("%d", &(s));
  ;
  for (int i = 1; i <= n; i++) scanf("%d", &(ar[i]));
  for (int i = 1; i <= n; i++) scanf("%d", &(br[i]));
  int pool_p = n + n + 1;
  int pool_s = n + n + 2;
  int src = n + n + 3;
  int des = n + n + 4;
  MCMF.init(des);
  for (int i = 1; i <= n; i++) {
    int s = i;
    int e = i + n;
    MCMF.insert(s, e, 1, 0);
    MCMF.insert(e, pool_p, 1, -1 * ar[i]);
    MCMF.insert(e, pool_s, 1, -1 * br[i]);
    MCMF.insert(src, s, 1, 0);
  }
  MCMF.insert(pool_p, des, p, 0);
  MCMF.insert(pool_s, des, s, 0);
  pair<long long, long long> res = MCMF.mincostmaxflow(src, des);
  long long ret = res.first * -1;
  printf("%lld\n", ret);
  MCMF.print(pool_p, n);
  MCMF.print(pool_s, n);
  return 0;
}
