
def gradingStudents(grades):
    updatedGrade = []
    for x in grades:
        if x >=38 and x%5 > 2:
            updatedGrade.append(str(((x // 5) + 1 ) * 5))
        else:
            updatedGrade.append(str(x))
    return updatedGrade

if __name__ == '__main__':
    n = int(input())
    grades = []
    for _ in range(n):
        grades_item = int(input())
        grades.append(grades_item)
    result = gradingStudents(grades)
    print('\n'.join(result))
0a5880fe2ced72c7e2db5c4bff4eadc8a23987e7
<mask token>

def gradingStudents(grades):
    updatedGrade = []
    for x in grades:
        if x >= 38 and x % 5 > 2:
            updatedGrade.append(str((x // 5 + 1) * 5))
        else:
            updatedGrade.append(str(x))
    return updatedGrade


<mask token>

def gradingStudents(grades):
    updatedGrade = []
    for x in grades:
        if x >= 38 and x % 5 > 2:
            updatedGrade.append(str((x // 5 + 1) * 5))
        else:
            updatedGrade.append(str(x))
    return updatedGrade


if __name__ == '__main__':
    n = int(input())
    grades = []
    for _ in range(n):
        grades_item = int(input())
        grades.append(grades_item)
    result = gradingStudents(grades)
    print('\n'.join(result))


def gradingStudents(grades):
    updatedGrade = []
    for x in grades:
        if x >=38 and x%5 > 2:
            updatedGrade.append(str(((x // 5) + 1 ) * 5))
        else:
            updatedGrade.append(str(x))
    return updatedGrade

if __name__ == '__main__':
    n = int(input())
    grades = []
    for _ in range(n):
        grades_item = int(input())
        grades.append(grades_item)
    result = gradingStudents(grades)
    print('\n'.join(result))