Bart´s sister Lisa has created a new civilization on a two-dimensional grid. At the outset each grid location may be occupied by one of three life forms: Rocks, Scissors, or Papers. Each day, differing life forms occupying horizontally or vertically adjacent grid locations wage war. In each war, Rocks always defeat Scissors, Scissors always defeat Papers, and Papers always defeat Rocks. At the end of the day, the victor expands its territory to include the loser´s grid position. The loser vacates the position.
Your job is to determine the territory occupied by each life form after n days.
2 3 3 1 RRR RSR RRR 3 4 2 RSPR SPRS PRSP
RRR RRR RRR RRRS RRSP RSPR 0