import java.io.*;
import java.util.Random;

public class RollingDie {

  public static void main(String argv[]) throws IOException {
    final int SIDES = 6;
    int trials; //number of times you roll the die
    int face;   // face on die
    int frequency[] = new int[SIDES+1]; // frequency for each face

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // read number of trials
    System.out.print("Enter number of trials: ");
    String str = br.readLine();
    trials = Integer.parseInt(str);

    // Random number generator. The default seed is the current time.
    Random value = new Random();
    for(int roll=1;roll<=trials;roll++) {
      // simulate rolling die
      face = Math.abs(value.nextInt() % SIDES)+1;
      frequency[face]++;
    }

    // print results
    System.out.println("Number of dots on face: \t1\t2\t3\t4\t5\t6");
    System.out.print("Frequency:\t\t\t");
    for(face=1;face<=SIDES;face++) {
      System.out.print(frequency[face]+"\t");
    }
  }
}
   