'''****** Задание ******** *Дед Мороз и конфеты. ''' N = int(input()) M = int(input()) print(M // N) print(M % N)