The mahjong puzzle game also decided to dress up for the Christmas holiday and called itself Christmas Dimensions. Various New Year's attributes are drawn on square three-dimensional blocks: Santa hats, candy canes, Christmas tree decorations, snowmen, fir trees, bells, deer, sweets, and so on. Your task is to search and find pairs of cubes with the same patterns and remove them if they are not sandwiched between other blocks. Remember about time, it is limited and the limit is very small, so do not waste time, but quickly remove blocks in Christmas Dimensions, turning the pyramid to the left or right to quickly find options for removal.