Under construction

Still being built. Things may change

Bigger Sokoban 40k

Time limit1sMemory limit1024 MB

Summary
Build a Bigger Sokoban grid with one 2x2 box and one 2x2 storage area that takes at least 40,000 moves to solve.
Level

Hard9 of 10

Topics
Implementation, Simulation
Solved
No attempts yet

Problem

Sokoban is a famous puzzle game. The player moves around in an N×MN \times M grid and pushes 1×11 \times 1 boxes onto 1×11 \times 1 storage locations.

Bigger Sokoban is a variation of Sokoban where the boxes and storage locations are larger than 1×11 \times 1. This problem uses 2×22 \times 2 for both.

The rules of Bigger Sokoban are the same as Sokoban. Each square in the grid is either empty or a wall. Some 2×22 \times 2 areas of empty squares each contain one 2×22 \times 2 box, and some 2×22 \times 2 areas of empty squares are each marked as a 2×22 \times 2 storage location.

The player moves up, down, left, or right to adjacent empty squares. The player cannot pass through walls, boxes, or the outside of the grid. If the player tries to move into a box, the box is pushed one square in that direction. A box cannot be pushed into another box, a wall, or outside the grid, and boxes cannot be pulled. The number of boxes equals the number of storage locations. The puzzle is solved when every box is on a storage location.

Your task is to build a Bigger Sokoban grid that requires at least 40,000 moves to solve. The grid must satisfy these constraints:

  • 1≤N,  M,  N+M≤1001 \leq N, \; M, \; N+M \leq 100.
  • The grid contains exactly one box and one storage location.
  • The player, the box, and the storage location do not overlap.

Input

There is no input for this problem.

Output

Print two space-separated integers NN and MM on the first line. They give the size of the grid.

On each of the following NN lines, print a string of length MM that describes one row of the grid. Each string consists of ., #, P, B, and S, which mean an empty square, a wall, the player, a box, and a storage location, respectively.

The grid must contain exactly one P, exactly four B, and exactly four S. The B characters must form one 2×22 \times 2 square, and the S characters must form one 2×22 \times 2 square. The grid must be solvable.

Examples1

  1. Example 1

    Input
    <There are no inputs>
    
    Expected output
    5 6
    ....SS
    ....SS
    .#BB#.
    ..BB.P
    ......