#include <bits/stdc++.h>
using namespace std;
const int M = 1000005;
int n, m, x, y, q, l, r, k, a, b, ans[M];
long long sum;
int main() {
  cin >> n >> a >> b;
  if (a > b) swap(a, b);
  if (a == 1) {
    for (int i = 1; i <= n; i++) cout << i << " ";
    return 0;
  }
  bool f = false;
  for (int i = 0; i <= n; i++) {
    int k = n - i * a;
    if (k < 0) break;
    if (k % b == 0) {
      f = true;
      x = i;
      y = k / b;
      break;
    }
  }
  if (!f) return cout << -1, 0;
  int i = 1;
  while (1) {
    if (x) {
      int t = i;
      for (int j = 1; j < a; j++, i++) ans[i] = i + 1;
      ans[i] = t;
      i++;
      x--;
    } else if (y) {
      int t = i;
      for (int j = 1; j < b; j++, i++) ans[i] = i + 1;
      ans[i] = t;
      i++;
      y--;
    } else
      break;
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
