#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a, b;
  scanf("%d%d%d", &n, &a, &b);
  for (int x = 0; x * a <= n; ++x) {
    if ((n - x * a) % b) continue;
    int y = (n - x * a) / b;
    int cur = 1;
    for (int i = 0; i < x; ++i) {
      printf("%d ", cur + a - 1);
      for (int k = 0; k < a - 1; ++k) {
        printf("%d ", cur + k);
      }
      cur += a;
    }
    for (int i = 0; i < y; ++i) {
      printf("%d ", cur + b - 1);
      for (int k = 0; k < b - 1; ++k) {
        printf("%d ", cur + k);
      }
      cur += b;
    }
    putchar('\n');
    return 0;
  }
  puts("-1");
  return 0;
}
