Check the grade when input