output_description: If there are no sequences that satisfy the conditions, print `-1`.
  
  Otherwise, print N integers. The i-th integer should be the i-th element of
  the sequence that you constructed.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N A B
attempt: N, A, B = map(int, input().split())
  l = list(range(1, N + 1))
  t = 0
  s = ""
  S = ""
  if N // max(A, B) == min(A, B):
      if A > B:
          while l:
              t += A
              s = ""
              while t:
                  if len(l) == 0:
                      break
                  s = str(l.pop()) + " " + s
                  t -= 1
              S += s
      elif A <= B:
          while l:
              t += B
              s = ""
              while t:
                  if len(l) == 0:
                      break
                  s += " " + str(l.pop())
                  t -= 1
              S = s + S
  elif A + B - 1 <= N:
      p = N // max(A, B)
      if A > B:
  
          tk = l[: B - p - 1]
          l = l[B - 1 - p :]
          while l:
              t += A
              s = ""
              while t:
                  if len(l) == 0:
                      break
                  s = str(l.pop()) + " " + s
                  t -= 1
              S += s
          kk = ""
          for i in tk[::-1]:
              S += " " + str(i)
      elif A < B:
          tk = l[: A - p - 2]
          l = l[A - p - 2 :]
          while l:
              t += B
              s = ""
              while t:
                  if len(l) == 0:
                      break
                  s += " " + str(l.pop())
                  t -= 1
              S = s + S
              kk = ""
          S = S[1:]
          for i in tk:
              S = str(i) + " " + S
      elif A == B:
          tk = l[: A - p]
          l = l[A - p :]
          while l:
              t += B
              s = ""
              while t:
                  if len(l) == 0:
                      break
                  s += " " + str(l.pop())
                  t -= 1
              S = s + S
              kk = ""
          S = S[1:]
          for i in tk:
              S = str(i) + " " + S
  else:
      S = -1
  print(S)
  
problem_description: Statement
  
  Determine if there exists a sequence obtained by permuting 1,2,...,N that
  satisfies the following conditions:
  
    * The length of its longest increasing subsequence is A.
    * The length of its longest decreasing subsequence is B.
  
  If it exists, construct one such sequence.
samples: [{"input": "5 3 2", "output": "2 4 1 5 3\n    \n\nOne longest increasing subsequence of this sequence is {2,4,5}, and one\nlongest decreasing subsequence of it is {4,3}.\n\n* * *"}, {"input": "7 7 1", "output": "1 2 3 4 5 6 7\n    \n\n* * *"}, {"input": "300000 300000 300000", "output": "-1"}]