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