@@ -0,0 +1,1494 @@
+package com.javarush.task.task16.task1626;%0A%0Apublic class Solution %7B%0A    public static int number = 5;%0A%0A    public static void main(String%5B%5D args) %7B%0A        new Thread(new CountDownRunnable(), %22%D0%A3%D0%BC%D0%B5%D0%BD%D1%8C%D1%88%D0%B0%D0%B5%D0%BC%22).start();%0A        new Thread(new CountUpRunnable(), %22%D0%A3%D0%B2%D0%B5%D0%BB%D0%B8%D1%87%D0%B8%D0%B2%D0%B0%D0%B5%D0%BC%22).start();%0A    %7D%0A%0A    public static class CountUpRunnable implements Runnable %7B%0A        private int currentIndex = 0;%0A%0A        @Override%0A        public void run() %7B%0A            try %7B%0A                while (true) %7B%0A                    Thread.sleep(500);%0A                    currentIndex++;%0A                    System.out.println(toString());%0A                    if (currentIndex == Solution.number) return;%0A                %7D%0A            %7D catch (InterruptedException e)%7B%0A            %7D%0A        %7D%0A%0A        public String toString() %7B%0A            return Thread.currentThread().getName() + %22: %22 + currentIndex;%0A        %7D%0A    %7D%0A%0A    public static class CountDownRunnable implements Runnable %7B%0A        private int countIndexDown = Solution.number;%0A%0A        public void run() %7B%0A            try %7B%0A                while (true) %7B%0A                    System.out.println(toString());%0A                    countIndexDown -= 1;%0A                    if (countIndexDown == 0) return;%0A                    Thread.sleep(500);%0A                %7D%0A            %7D catch (InterruptedException e) %7B%0A            %7D%0A        %7D%0A%0A%0A%0A        public String toString() %7B%0A            return Thread.currentThread().getName() + %22: %22 + countIndexDown;%0A        %7D%0A    %7D%0A%7D%0A

Complete task1626