123456zmy is playing GT: New Horizons and wants to build $$$n$$$ Bricked Blast Furnaces. A Bricked Blast Furnace is a multiblock structure. In this problem, we only consider the layer containing the Bricked Blast Furnace block.
Bricked Blast Furnace and the layer containing the block. We use 'B', 'F', and 'L' (or their lowercase) to represent Bricked Blast Furnace, Firebricks, and Lava, respectively. A complete Bricked Blast Furnace structure consists of 7 Firebricks, 1 Lava, and 1 Bricked Blast Furnace. The structure can be rotated arbitrarily, as shown below.
![]() | ![]() | ![]() | ![]() |
Multiple structures can share the same Firebricks 'F'. However, sharing 'B' or 'L' is not allowed. For example, there are 4 complete Bricked Blast Furnace structures below.
123456zmy wants to use no more than $$$3\times10^5$$$ Firebricks to form at least $$$n$$$ Bricked Blast Furnace structures. Please tell him how to arrange the blocks.
The input contains only one line with an integer $$$n$$$ $$$(1\le n\le 10^5)$$$, representing the number of Bricked Blast Furnace.
The first line of output contains an integer $$$k$$$ $$$(0\le k\le 10^6)$$$, representing the total number of blocks used.
The next $$$k$$$ lines each contain two integers $$$x$$$, $$$y$$$ and a character $$$c$$$, indicating the position and type of the block to be placed $$$(-10^{9}\le x,y \le 10^{9}, c\in\{$$$ 'B', 'b', 'F', 'f', 'L', 'l' $$$\})$$$.
You cannot place multiple blocks at the same position, i.e., $$$(x,y)$$$ must be distinct.
Note that each Bricked Blast Furnace must have a complete structure, but other blocks do not necessarily need to belong to a complete structure.
1
9 1 1 F 1 2 B 1 3 F 2 1 F 2 2 L 2 3 F 3 1 F 3 2 F 3 3 F