$/=words;put substr "BW"x௱,$_+$2.ord,$0 for ^$1