!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}({0:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,u){function i(e){try{c(r.next(e))}catch(e){u(e)}}function a(e){try{c(r.throw(e))}catch(e){u(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this;t.__esModule=!0;var a=u(n(1));function c(e){var t,n;return o(this,function(r){switch(r.label){case 0:t=e.split(/\s+/).filter(function(e){return e.length>0}),n=0,r.label=1;case 1:return n<t.length?[4,t[n]]:[3,4];case 2:r.sent(),r.label=3;case 3:return n++,[3,1];case 4:return[2]}})}t.readInput=function(){return new Promise(function(e,t){a.default.readFile("/dev/stdin","utf8",function(n,r){n?t(n):e(r)})})},t.getFoolIterator=c,t.getFoolNextInt=function(){return r(i,void 0,void 0,function(){var e,n;return o(this,function(r){switch(r.label){case 0:return[4,t.readInput()];case 1:return e=r.sent(),n=c(e),[2,function(){return parseInt(n.next().value)}]}})})},t.getChottoMashinaNext=function(){return r(i,void 0,void 0,function(){var e,n;return o(this,function(r){switch(r.label){case 0:return[4,t.readInput()];case 1:return e=r.sent(),n=function(){var t,n,r;return o(this,function(o){switch(o.label){case 0:t=-1,n=0,o.label=1;case 1:return n<=e.length?" "!==e[n]&&"\n"!==e[n]&&n!==e.length?[3,5]:-1!==t?[3,2]:[3,6]:[3,7];case 2:return r=e.substring(t,n),t=-1,[4,r];case 3:o.sent(),o.label=4;case 4:return[3,6];case 5:-1===t&&(t=n),o.label=6;case 6:return n++,[3,1];case 7:return[2]}})}(),[2,function(){return n.next().value}]}})})},t.getChottoMashinaNextInt=function(){return r(i,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,t.getChottoMashinaNext()];case 1:return e=n.sent(),[2,function(){return parseInt(e())}]}})})}},1:function(e,t){e.exports=require("fs")},16:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,u){function i(e){try{c(r.next(e))}catch(e){u(e)}}function a(e){try{c(r.throw(e))}catch(e){u(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},u=this;t.__esModule=!0;var i=n(0);r(u,void 0,void 0,function(){var e,t,n,r,u,a,c,l,s,f,h,p,b,d;return o(this,function(o){switch(o.label){case 0:return[4,i.getChottoMashinaNextInt()];case 1:for(e=o.sent(),t=e(),n=new Array,r=0;r<t;r++)n.push(e()-1);for(u=new Array,a=!1,c=!0;c;){if(c=!1,n.reduce(function(e,t){return e&&0===t},!0)){for(a=!0,l=0,s=n;l<s.length;l++)f=s[l],u.push(f);break}for(h=t-1;h>=0;h--)if(n[h]===h){u.push(h),n.splice(h,1),c=!0;break}}if(u=u.reverse(),a)for(p=0,b=u;p<b.length;p++)d=b[p],console.log(d+1);else console.log(-1);return[2]}})})}});


Measured memory_bytes: 21320