# -*- coding: utf-8 -*-

DAY_IN_HOURS = 24

def main():
    start_time, end_time = map(int, input().split())

    duration = end_time - start_time

    if duration <= 0:
        duration += DAY_IN_HOURS

    print('O JOGO DUROU {:} HORA(S)'.format(duration))

if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-

DAY_IN_HOURS = 24

def main():
    start_time, end_time = map(int, input().split())

    duration = end_time - start_time

    if duration <= 0:
        duration += DAY_IN_HOURS

    print('O JOGO DUROU {:} HORA(S)'.format(duration))

if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-