map{$-++,@@[$a,$_]=@@[$_,$a]if$@[$a=$_-1]>$@[$_];printf"compare =%3d swap =%3d data:"."%3d"x@@.$/,++$c,$-,@@}1..--$@for($@,@@)=<>