#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  if (a == 1 || b == 1) {
    for (int i = 1; i <= n; i++) cout << i << " ";
    return 0;
  }
  int x = n, f = 0;
  int y = n / a;
  while (y >= 0 && f == 0) {
    int z = x;
    z = z - y * a;
    int k = z % b;
    if (k == 0) {
      f = 1;
      break;
    } else
      y--;
  }
  if (f == 0) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= y * a;) {
    int j = i;
    for (i = i + 1; i < j + a; i++) {
      cout << i << " ";
    }
    cout << j << " ";
  }
  for (int i = y * a + 1; i <= x;) {
    int j = i;
    for (i = i + 1; i < j + b; i++) {
      cout << i << " ";
    }
    cout << j << " ";
  }
  return 0;
}
