public static void main(String[] args) {
        //напишите тут ваш код
        Scanner s = new Scanner(System.in);
        int min = Integer.MAX_VALUE;
        while (s.hasNextInt()) {
            int x = s.nextInt();
            if (x < min) {
                min = x;
            }
            else if (!(s.hasNextInt())) {
                break;
            }
        }
            System.out.println(min);
        int secondMin;
        while (s.hasNextInt()) {
            int y = s.nextInt();
            if (y == min) {
                continue;
            }
            else if (y < min) {
                secondMin = y;
            }
        }
            System.out.println(secondMin);

    }
Ошибка java: variable secondMin might not have been initialized