Problem: After too much playing on paper, Iahub has switched to computer games. The game he plays is called "Block Towers". It is played in a rectangular grid with n rows and m columns (it contains n × m cells). The goal of the game is to build your own city. Some cells in the grid are big holes, where Iahub can't build any building. The rest of cells are empty. In some empty cell Iahub can build exactly one tower of two following types:

  1. Blue towers. Each has population limit equal to 100. 
  2. Red towers. Each has population limit equal to 200. However, it can be built in some cell only if in that moment at least one of the neighbouring cells has a Blue Tower. Two cells are neighbours is they share a side. 



Iahub is also allowed to destroy a building from any cell. He can do this operation as much as he wants. After destroying a building, the other buildings are not influenced, and the destroyed cell becomes empty (so Iahub can build a tower in this cell if needed, see the second example for such a case).

Iahub can convince as many population as he wants to come into his city. So he needs to configure his city to allow maximum population possible. Therefore he should find a sequence of operations that builds the city in an optimal way, so that total population limit is as large as possible.

He says he's the best at this game, but he doesn't have the optimal solution. Write a program that calculates the optimal one, to show him that he's not as good as he thinks. 

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 500). Each of the next n lines contains m characters, describing the grid. The j-th character in the i-th line is '.' if you're allowed to build at the cell with coordinates (i, j) a tower (empty cell) or '#' if there is a big hole there. 

Output

Print an integer k in the first line (0 ≤ k ≤ 106) — the number of operations Iahub should perform to obtain optimal result.

Each of the following k lines must contain a single operation in the following format:

  1. «B x y» (1 ≤ x ≤ n, 1 ≤ y ≤ m) — building a blue tower at the cell (x, y); 
  2. «R x y» (1 ≤ x ≤ n, 1 ≤ y ≤ m) — building a red tower at the cell (x, y); 
  3. «D x y» (1 ≤ x ≤ n, 1 ≤ y ≤ m) — destroying a tower at the cell (x, y). 



If there are multiple solutions you can output any of them. Note, that you shouldn't minimize the number of operations.

Examples

Input

2 3
..#
.#.


Output

4
B 1 1
R 1 2
R 2 1
B 2 3


Input

1 3
...


Output

5
B 1 1
B 1 2
R 1 3
D 1 2
R 1 2

Solution (in JAVA):

Solution:
import static java.lang.System.*;

import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class D327{
    public static Scanner sc = new Scanner(in);
    //public static Random sc=new Random();




    boolean[][] passed;
    int H,W;
    StringBuilder sb;


    public void dfs(int y,int x){
        passed[y][x]=true;

        for(int i=0;i<4;i++){
            int nx=x+dx[i],ny=y+dy[i];
            if(0<=nx && nx< W && 0<= ny && ny<H){
                if(!passed[ny][nx] && map[ny][nx]=='.'){
                    dfs(ny,nx);
                }
            }
        }
        if(topx ==x && topy==y)return;

        sb.append("D "+(y+1)+" "+(x+1)+br);
        sb.append("R "+(y+1)+" "+(x+1)+br);
        len+=2;
    }

    int[] dx=new int[]{1,0,-1,0};
    int[] dy=new int[]{0,1,0,-1};

    int len=0;

    int topy,topx;

    char[][] map;
    public void run(){

        H=sc.nextInt();W=sc.nextInt();
        passed=new boolean[H][W];
        map=new char[H][W];

        for(int h=0;h<H;h++){
            map[h]=sc.next().toCharArray();
        }

        sb=new StringBuilder();
        //to blue
        for(int h=0;h<H;h++)for(int w=0;w<W;w++){
            if(map[h][w]=='.'){
                sb.append("B "+(h+1)+" "+(w+1)+br);
                len++;
            }
        }


        for(int h=0;h<H;h++)for(int w=0;w<W;w++){
            if(map[h][w]=='.' && !passed[h][w]){
                topy=h;topx=w;
                dfs(h,w);

            }
        }
        ln(len);
        ln(sb);
   }
    public static void main(String[] _) {
        new D327().run();
    }
    //output lib
    static final String br=System.getProperty("line.separator");
    static final String[] asep=new String[]{""," ",br,br+br};
    static String str(Boolean o){
        return o?"YES":"NO";
    }
//  static String str(Double o){
//      return String.format("%.8f",o);
//  }
    static <K,V> String str(Map<K, V> map){
        StringBuilder sb=new StringBuilder();
        boolean isFirst=true;
        for(Entry<K,V> set:map.entrySet()){
            if(!isFirst)sb.append(br);
            sb.append(str(set.getKey())).append(":").append(str(set.getValue()));
            isFirst=false;
        }
        return sb.toString();
    }
    static <E> String str(Collection<E> list){
        StringBuilder sb=new StringBuilder();
        boolean isFirst=true;
        for(E e:list){
            if(!isFirst)sb.append(" ");
            sb.append(str(e));
            isFirst=false;
        }
        return sb.toString();
    }

    static String str(Object o){
        int depth=_getArrayDepth(o);
        if(depth>0)return _strArray(o,depth);
        Class<?> c=o.getClass();
        if(c.equals(Boolean.class))return str((Boolean)o);
        //if(c.equals(Double.class))return str((Double)o);

        return o.toString();
    }
    static int _getArrayDepth(Object o){
        if(!o.getClass().isArray() || Array.getLength(o)==0) return 0;
        return  1+_getArrayDepth(Array.get(o,0));
    }
    static String _strArray(Object o,int depth){
        if(depth==0) return str(o);
        StringBuilder sb=new StringBuilder();
        for(int i=0,len=Array.getLength(o);i<len;i++){
            if(i!=0)sb.append(asep[depth]);
            sb.append(_strArray(Array.get(o,i),depth-1));
        }
        return sb.toString();
    }
    static void pr(Object... os){
        boolean isFirst=true;
        for(Object o:os){
            if(!isFirst)out.print(" ");
            out.print(o);
            isFirst=false;
        }
    }
    static void ln(){
        out.println();
    }
    static void ln(Object... os){
        for(Object o:os){
            pr(o);ln();
        }
    }
}