@n=(_,a..z,'.');map{$l{$n[$_]}=$_}0..27;@c=map{$l{$_}}split//,pop;$p[$_[0]*$_%@c]=$n[($c[$_]+$_)%@n]for 0..$#c;join'',@p