Divide input into blocks