#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6;
int a[N];
int main() {
  int n, x, y;
  scanf("%d %d %d", &n, &x, &y);
  for (int i = 0; i < n; i++) {
    a[i] = i;
  }
  for (int i = 0; i * x <= n; i++) {
    if ((n - i * x) % y == 0) {
      int j = (n - i * x) / y;
      int k = 0;
      for (; i--; k += x) {
        for (int l = k; l <= k + x - 2; l++) {
          swap(a[l], a[l + 1]);
        }
      }
      for (; j--; k += y) {
        for (int l = k; l <= k + y - 2; l++) {
          swap(a[l], a[l + 1]);
        }
      }
      for (k = 0; k < n; k++) {
        printf("%d ", a[k] + 1);
      }
      return 0;
    }
  }
  puts("-1");
  return 0;
}
