Vanya wrote the number 1 on the board and then several more numbers. Each time Vanya writes the next number, Mitya calculates the median of the numbers on the board and writes it down in his notebook. At a certain point, the numbers in Mitya's notebook are: .
a) What number was written on the board fourth?
b) What number was written on the board eighth?