module.exports=function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var i=r(1);r(2)(i.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";var i=r(3),n=r(5);t.exports=function(t){var e=new i(t);n(e)}},function(t,e,r){"use strict";var i=r(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new i(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,r){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,r){"use strict";var i=r(6);t.exports=function(t){for(var e=t.in(),r=new Array(e),n=0;n<e;n++)r[n]=t.in();for(var s=new i(r),o=new i(r,function(t,e){return Math.min(t,e)},99999999999),u=t.in(),h=0;h<u;h++){var c=t.in(),f=t.in(),a=t.in();0==c?console.log(o.query(f,a)):console.log(s.query(f,a))}}},function(t,e,r){"use strict";t.exports=class{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e){return Math.max(t,e)},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-99999999999;this.opf=e,this.inv=r,this.n=0,this.tree=[],this.init(t.length),this.build(t)}init(t){for(var e=1;e<t;)e*=2;this.n=e,this.tree=new Array(2*e).fill(this.inv)}build(t){if(this.n<=2)this.tree=t;else for(var e=0;e<this.n-1;e++)this.update(e,t[e])}update(t,e){for(t+=this.n-1,this.tree[t]=e;t>0;)t=Math.floor((t-1)/2),this.tree[t]=this.opf(this.tree[2*t+1],this.tree[2*t+2])}query(t,e){return this.n<=2?e-t==2?this.opf(this.tree[t],this.tree[e-1]):this.tree[t]:this.query_rc(t,e,0,0,this.n)}query_rc(t,e,r,i,n){if(e<=i||n<=t)return this.inv;if(t<=i&&n<=e)return this.tree[r];var s=Math.floor((n+i)/2),o=this.query_rc(t,e,2*r+1,i,s),u=this.query_rc(t,e,2*r+2,s,n);return this.opf(o,u)}}}]);
