Task 3. In one school, four friends study - all in different grades: the youngest is in the first grade, and the oldest is in the fourth. Determine the name, surname, and grade of each of them, given that:

1) Borya is not a first-grader;
2) when Vasya goes to the pool on the neighboring Southern Street, Ivanov walks his dog in his courtyard on Green Street;
3) Misha is one year older than Dima;
4) Borya and Orlov are neighbors and live on Northern Street;
5) Krylov met Petrov exactly a year ago, when he was still a first-grader;
6) Vasya gave Borya a textbook that he used last year.
Answer: Dima Ivanov is in the first grade, Misha Krylov is in the second, Borya Petrov is in the third, and Vasya Orlov is in the fourth.

Solution. First, let's match the boys' names with their grades. From conditions 1, 3, and 6, it follows that only Dima can be a first-grader. Then, from condition 3, Misha is in the second grade. From condition 6, Vasya is older than Borya, so Vasya is in the fourth grade, and Borya is in the third.

Now, let's match the names with the surnames. From condition 5, it follows that Krylov is currently in the second grade, so this is Misha. From conditions 2 and 4, it follows that Borya is neither Orlov nor Ivanov, so he is Petrov. From condition 2, it follows that Vasya is not Ivanov, so he is Orlov. Then Dima is Ivanov.