!function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=4)}([function(t,n,e){"use strict";var r=this&&this.__awaiter||function(t,n,e,r){return new(e||(e=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new e(function(n){n(t.value)}).then(u,a)}c((r=r.apply(t,n||[])).next())})},i=this&&this.__generator||function(t,n){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=n.call(t,u)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},u=this;n.__esModule=!0;var a=o(e(1));function c(t){var n,e;return i(this,function(r){switch(r.label){case 0:n=t.split(/\s+/).filter(function(t){return t.length>0}),e=0,r.label=1;case 1:return e<n.length?[4,n[e]]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}})}n.readInput=function(){return new Promise(function(t,n){a.default.readFile("/dev/stdin","utf8",function(e,r){e?n(e):t(r)})})},n.getFoolIterator=c,n.getFoolNextInt=function(){return r(u,void 0,void 0,function(){var t,e;return i(this,function(r){switch(r.label){case 0:return[4,n.readInput()];case 1:return t=r.sent(),e=c(t),[2,function(){return parseInt(e.next().value)}]}})})},n.getChottoMashinaNext=function(){return r(u,void 0,void 0,function(){var t,e;return i(this,function(r){switch(r.label){case 0:return[4,n.readInput()];case 1:return t=r.sent(),e=function(){var n,e,r;return i(this,function(i){switch(i.label){case 0:n=-1,e=0,i.label=1;case 1:return e<=t.length?" "!==t[e]&&"\n"!==t[e]&&e!==t.length?[3,5]:-1!==n?[3,2]:[3,6]:[3,7];case 2:return r=t.substring(n,e),n=-1,[4,r];case 3:i.sent(),i.label=4;case 4:return[3,6];case 5:-1===n&&(n=e),i.label=6;case 6:return e++,[3,1];case 7:return[2]}})}(),[2,function(){return e.next().value}]}})})},n.getChottoMashinaNextInt=function(){return r(u,void 0,void 0,function(){var t;return i(this,function(e){switch(e.label){case 0:return[4,n.getChottoMashinaNext()];case 1:return t=e.sent(),[2,function(){return parseInt(t())}]}})})}},function(t,n){t.exports=require("fs")},,,function(t,n,e){"use strict";var r=this&&this.__awaiter||function(t,n,e,r){return new(e||(e=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new e(function(n){n(t.value)}).then(u,a)}c((r=r.apply(t,n||[])).next())})},i=this&&this.__generator||function(t,n){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=n.call(t,u)}catch(t){o=[6,t],r=0}finally{e=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this;n.__esModule=!0;var u=e(5),a=e(0);r(o,void 0,void 0,function(){var t,n,e,r,o,c,l,s,f,h,b,p,v,d;return i(this,function(i){switch(i.label){case 0:return[4,a.getChottoMashinaNextInt()];case 1:for(t=i.sent(),n=t(),e=new u.BigBit(t()),r=new Array(n),v=0;v<n;v++)r[v]=new u.BigBit(t());for(o=[1],c=[],l=function(t){var n=new u.BigBit(o),e=[0,0];r.forEach(function(t){t.and(n).isZero()?e[1]++:e[0]++}),c[t]={0:e[0],1:e[1]},o.unshift(0)},v=0;v<41;v++)l(v);for(g={},s=function(t){return void 0!==g[t]?g[t]:(g[t]=Math.pow(2,t),g[t])},f=function(t){for(var n=0,e=0;e<t;e++)n+=Math.max(c[e][0],c[e][1])*s(e);return n},h=function(){var t={};return function(n){return void 0!==t[n]?t[n]:(t[n]=f(n),t[n])}}(),b=function(){for(var t=0,n=0;n<c.length;n++)t+=c[n][0]*s(n);return t}(),p=0,v=40;v>=0;v--)e.getHighestZeroIndex()<v||(1===e.getBit(v)?(d=p+h(v)+c[v][0]*s(v),b=Math.max(b,d),p+=Math.max(c[v][1],c[v][0])*s(v)):p+=c[v][0]*s(v));return console.log(Math.max(p,b)),[2]}var g})})},function(t,n,e){"use strict";n.__esModule=!0;var r=function(){function t(n){var e=this;if(this.or=function(n){return new t(t.common(n,e,function(t,n){return t|n}))},this.and=function(n){return new t(t.common(n,e,function(t,n){return t&n}))},this.xor=function(n){return new t(t.common(n,e,function(t,n){return t^n}))},this.getBit=function(t){return e.bit[t]},this.getHighestZeroIndex=function(){return e.isZero()?-1:e.bit.length-1},this.isZero=function(){return 1===e.bit.length&&0===e.bit[0]},this.toString=function(){return e.bit.slice(0).reverse().join("")},this.toNumber=function(){for(var t=0,n=0;n<e.bit.length;n++)1===e.bit[n]&&(t+=Math.pow(2,n));return t},"number"==typeof n)this.bit=t.stringToBit(n.toString(2));else if("string"==typeof n){var r=n.replace(/^0+/,"");0===r.length&&(r="0"),this.bit=t.stringToBit(r)}else if(Array.isArray(n)){var i=n.lastIndexOf(1);this.bit=i<0?[0]:n.slice(0,i+1)}}return t.stringToBit=function(t){for(var n=new Array(t.length),e=0;e<t.length;e++){if("0"!==t[e]&&"1"!==t[e])throw Error(t+" is not bit");var r="0"===t[e]?0:1;n[t.length-e-1]=r}return n},t.common=function(t,n,e){for(var r=Math.max(t.bit.length,n.bit.length),i=new Array(r),o=0;o<r;o++){var u=e(o<t.bit.length?t.bit[o]:0,o<n.bit.length?n.bit[o]:0);i[r-o-1]=u}return i},t}();n.BigBit=r}]);
