#include <bits/stdc++.h>
using namespace std;
int arr[1000004];
int main() {
  int n, a, b;
  scanf("%d %d %d", &n, &a, &b);
  int ac = -1, bc = -1;
  for (int i = 0; i * a <= n; ++i) {
    int v = n - (i * a);
    if (v % b == 0) {
      ac = i, bc = v / b;
      break;
    }
  }
  if (ac == -1) {
    puts("-1");
    return 0;
  } else {
    int s = 1;
    while (ac) {
      int aa = s, bb = s + a - 1;
      while (aa < bb) {
        arr[aa] = aa + 1;
        ++aa;
      }
      arr[bb] = s;
      s = bb + 1;
      ac--;
    }
    while (bc) {
      int aa = s, bb = s + b - 1;
      while (aa < bb) {
        arr[aa] = aa + 1;
        ++aa;
      }
      arr[bb] = s;
      s = bb + 1;
      bc--;
    }
  }
  for (int i = 1; i <= n; ++i) printf("%d ", arr[i]);
}
