<>;map$a[@a&&1+$|--]+=$_,glob<>;print$#a=$a[2]?2:$a[1]?1:0," @a"