import java.util.*;
/* Modified from Kai */
public class diceSum057 {
   public static void main (String [] args) {
      Scanner sc = new Scanner(System.in);
      System.out.print("Desired dice sum: ");
      int a = sc.nextInt(); //The user's input
      if (a < 2 || a > 12) 
         return;
   
      Random rand = new Random();
      int d = 0;
      do {
         int b = rand.nextInt(6) + 1; // one to six
         int c = rand.nextInt(6) + 1;
         d = (b + c); 
         System.out.println(b + " and " + c + " = " + d); 
      }
      while (d != a); //The sum of the two randomly generated numbers do not equal the user's input
   }
}

/*
//Kai's code

Scanner sc = new Scanner(System.in);
System.out.print("Desired dice sum: ");
int a = sc.nextInt(); //The user's input
int b = math.rand(7); //A range of 7 numbers, starting at 0. 0-6
int c = math.rand(7);
int d = (b + c); 

do {
System.out.println(b + "and" + c + "= " + d); 
}
while (d != a); //The sum of the two randomly generated numbers do not equal the user's input


*/