(let* ((n (read))
       (m (read))
       (cs (loop repeat m
                 collect (cons (read) (read))))
       (dig (make-array n :initial-element -1))
       (valid t)
       (result))
  (loop for (s . c) in cs
        do (progn
             (when (and (<= 0 (aref dig (- s 1)))
                        (/= c (aref dig (- s 1))))
               (setf valid nil)
               (loop-finish))
             (setf (aref dig (- s 1)) c)))
  (loop for i from 0 below n
        with ldig = nil
        for d = (aref dig i)
        do (push (if (<= 0 d)
                     (progn
                       (setf ldig t)
                       d)
                     (if (or (not (zerop i)) ldig)
                         0 1))
                 result))
  (setf result (nreverse result))
  (when (and (zerop (car result))
             (cdr result))
    (setf valid nil))
  (if valid
      (format t "~{~a~}~%" result)
      (format t "-1~%")))
