// Arup Guha
// 4/12/2025
// Solution to Junior Knights Contest Problem: Generalized Fizz Buzz
// https://open.kattis.com/problems/generalizedfizzbuzz

import java.util.*;

public class fizzbuzz {

	public static void main(String[] args) {
	
		// Get input.
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		int a = stdin.nextInt();
		int b = stdin.nextInt();
		int cntAB = 0, cntA = 0, cntB = 0;
		
		// Go through each number.
		for (int i=1; i<=n; i++) {
		
			// Go in the order they suggest to check divisibility.
			if (i%a == 0 && i%b == 0) cntAB++;
			else if (i%a == 0) cntA++;
			else if (i%b == 0) cntB++;
		}
		
		// Ta da!
		System.out.println(cntA+" "+cntB+" "+cntAB);
	}

}