import java.util.*;
import java.lang.*;


class TaskManager {

    List<String> executedTasks;
    List<String> even;
    List<String> odd;

    // constructor
    public TaskManager() {
        executedTasks = new ArrayList<>();
        even = new ArrayList<>();
        odd = new ArrayList<>();

    }

    //method serving the list of tasks
    public void executeTasks(Deque<String> theQueue) {
        while (theQueue.size() > 0) {
            String theTask = theQueue.poll();
            System.out.println("Processing the task: " + theTask);
            char c = 'a';
            for (int n = 0; n < 50; n++) {
                String result = "";
                int count = (char) (Math.random() * 50 + 1);

                for (int i = 0; i < count; i++) {
                    result += c;
                }
                System.out.println(result);
                if (result.length() % 2 == 0) {
                    even.add(result);
                } else {
                    odd.add(result);
                }
            executedTasks.add(theTask);


                System.out.println("\nExecuted total " + executedTasks.size() + " tasks\n");


            }

        }

    }
}


    /* Name of the class has to be "Main" only if the class is public. */
    public class QueuesAndLoops {

        public static void main(String[] args) throws java.lang.Exception {


            char c = 'a';


            Deque<String> taskQueue1 = new ArrayDeque<>();

            for (int n = 0; n < 1; n++) {
                taskQueue1.offer("The first task number " + (n + 1));

            }


            TaskManager taskExecutor = new TaskManager();
            taskExecutor.executeTasks(taskQueue1);

            System.out.println("Parzyste:");
            System.out.println(taskExecutor.even);
            System.out.println("Nieparzyste:");
            System.out.println(taskExecutor.odd);
        }
    }