// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.Random;

import javax.swing.JOptionPane;

public class Tips2 {
   private static Random rng = new Random();
   private static final char[] outcome = { '1', 'X', '2' };
   public static void main(String[] args) {
      int nrow = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter no rows"));
      char[][] row = new char[nrow][3];
      for(int i = 1; i <= nrow; i++) {
         row[i-1][0] = '-';
         row[i-1][1] = '-';
         row[i-1][2] = '-';
         int res = rng.nextInt(3);
         row[i-1][res] = outcome[res];
      }
      for(int i = 1; i <= nrow; i++) {
         System.out.println(i + " " + row[i-1][0]+ row[i-1][1]+ row[i-1][2]);
      }
   }
}
