// Arup Guha
// 7/14/05
// Solution to BHCSI 7/15/05 Programming Contest Problem: Stock

import java.io.*;

public class stock {


  public static void main(String[] args) throws IOException {

    BufferedReader stdin = new BufferedReader
				(new InputStreamReader(System.in));

    // Read in number of stock days.
    System.out.println("How many days did you track your stock?");
    int num_days = Integer.parseInt(stdin.readLine());

    // Set up default min and max values.
    double min_val = 100, max_val = 0;
    int day_min = 1, day_max = 1;
   
    // Go through each day.
    for (int day=1; day <= num_days; day++) {

      // Read that day's stock price.
      System.out.println("What was the price of the stock on day "+day+"?");
      double price = Double.parseDouble(stdin.readLine());

      // Update the maximum seen and which day it occurred if necessary.
      if (price > max_val) {
        max_val = price;
        day_max = day;
      }

      // Update the minimum seen and which day it occurred if necessary.
      if (price < min_val) {
        min_val = price;
        day_min = day;
      }
    }

    // Calculate the days in between the max and min occurrences.
    int inbetween = Math.abs(day_min-day_max);

    // Print out the result.
    System.out.println("The minimum stock price was "+min_val+".");
    System.out.println("The maximum stock price was "+max_val+".");
    System.out.println("The number of days in between these prices was "+inbetween+".");

  }

}
