Suppose you have a grid of cells that is 6 wide and arbitrarily tall. In each cell is a word. Let the bottom row, which is row #1, be the last 6 words of sample.txt in order. Let the second to last row, which is row #2, be the 6 words before those in order. (etc.)
Then consider what happens when you remove some of the words according to the pattern pictured below. When the word in a pink-colored cell is removed, all of the words from previous cells are shifted forward. The new index of the word in cell C_i,j becomes C_i,j-1 unless it's originally in the last column where j=1, in which case the new index of the word in the cell C_i,j becomes C_i-1,j .
What words are in each of the 36 cells after removing all of the words in the pink cells 3333 times? Write a program that prints them in order, from top to bottom, left to right.
This file is the tiny_shakespeare dataset with all of the punctuation and line breaks removed.