$i=9;do{print$/,map{(sort abs$_-$ARGV[0],abs$i-$ARGV[1])[1]}1..9}while--$i