public void output() {
        StackElement[] headSaver = new StackElement[column.length];
        for (int k = 0; k < column.length; k++) {
            headSaver[k] = column[k].getHead();
        }
        
        for (int i = 0; i < column.length; i++) {
            for (int j = 0; j < column.length; j++) {
                System.out.print(Integer.toString(column[j].top()));
                column[j].pop();
            }
            System.out.println();
        }
        
        for (int k = 0; k < column.length; k++) {
            column[k].setNewHead(headSaver[k]);
        }
    }