import java.util.Scanner;

public class BeerSong 
{
  public static void main (String[] args) 
  {
    int beerNum = 99;
    String word = "bottles";
    
    boolean keepgoing = true;
    String answer;
    Scanner in = new Scanner(System.in);
    
    while ((beerNum > 0) && keepgoing)
    {
      if (beerNum == 1) 
      {
        word = "bottle";
      }

      System.out.println(beerNum + " " + word + " of beer on the wall.");
      System.out.println(beerNum + " " + word + " of beer.");
      System.out.println("If one of the bottles");
      System.out.println("should happen to fall...");
      beerNum = beerNum - 1;
      System.out.println("Continue? n to stop: ");
      answer = in.next();
      if (answer.equals("n"))
      {
        keepgoing = false;
      }
      
      if (beerNum < 1) 
      {
        System.out.println("No more bottles of beer on the wall.");
      }
    }
  }
}
