/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		int[] hgram = new int[9];
		Random rng = new Random();
		for (int i = 0; i < 30000; i++) {
			int[] a = getRandomSelection( 2, 3, rng );
			hgram[3*a[0] + a[1]]++;
		}
		for (int i = 0; i < hgram.length; i++) {
			if (i > 0) System.out.print(", ");
			System.out.print(hgram[i]);
		}
	}
	
	public static int[] getRandomSelection (int k, int n, Random rng) {
    	if (k > n) throw new IllegalArgumentException(
        	"Cannot choose " + k + " elements out of " + n + "."
    	);

	    HashMap<Integer, Integer> hash = new HashMap<Integer, Integer>(2 * k);
    	int[] output = new int[k];

		for (int i = 0; i < k; i++) {
        	int j = i + rng.nextInt(n - i);
            output[i] = (hash.containsKey(j) ? hash.remove(j) : j);
            if (j > i) hash.put(j, hash.containsKey(i) ? hash.remove(i) : i);
    	}
    	return output;
	}
}