#include <bits/stdc++.h>
using namespace std;
int marked[1000006];
int f(int i, int j) {
  if (j == 1) {
    return marked[i];
  }
  return f(marked[i], j - 1);
}
vector<int> v;
int main() {
  int n, a, b;
  scanf("%d %d %d", &n, &a, &b);
  int cut = -1;
  for (int i = 0; i <= n; i++) {
    if (i % a == 0 && (n - i) % b == 0) {
      cut = i;
      break;
    }
  }
  if (cut == -1) {
    printf("-1\n");
    return 0;
  }
  int cnt = 0;
  for (int i = 1; i <= cut; i++) {
    cnt++;
    v.push_back(i);
    if (cnt == a) {
      if ((int)v.size() >= 2) {
        rotate(v.begin(), v.begin() + 1, v.end());
      }
      for (int j = 0; j < v.size(); j++) {
        printf("%d ", v[j]);
      }
      cnt = 0;
      v.clear();
    }
  }
  cnt = 0;
  for (int i = cut + 1; i <= n; i++) {
    cnt++;
    v.push_back(i);
    if (cnt == b) {
      if ((int)v.size() >= 2) {
        rotate(v.begin(), v.begin() + 1, v.end());
      }
      for (int j = 0; j < v.size(); j++) {
        printf("%d ", v[j]);
      }
      cnt = 0;
      v.clear();
    }
  }
}
