import java.util.*; class M{ static Scanner s=new Scanner(System.in); static int getInt(){return Integer.parseInt(s.next());} public static void main(String[]$){ int w=getInt(),h=getInt(); char c=s.next().charAt(0); for(int i=0;i