# Arup Guha
# 4/8/2025
# Solution to Kattis Problem: Generalized Fizz Buzz
# https://open.kattis.com/problems/generalizedfizzbuzz

# Get input
toks = input().split()
n = int(toks[0])
a = int(toks[1])
b = int(toks[2])

# My counters.
divN = 0
divA = 0
divB = 0

# Go in order.
for i in range(1,n+1):

    # Process divisibility in the order requested.
    if i%a == 0 and i%b == 0:
        divN += 1
    elif i%a == 0:
        divA += 1
    elif i%b == 0:
        divB += 1

# Ta da!
print(divA, divB, divN)
