// Arup Guha
// 7/14/05
// Solution to BHCSI 7/15/05 Programming Contest Problem: Stock
// Edited on 7/13/06 for BHCSI Mock Programming Contest for
// file input and use of the Scanner.

import java.util.*;
import java.io.*;

public class stock {


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

    Scanner fin = new Scanner(new File("stock.in"));

    // Read in number of stock days.
    int num_days = fin.nextInt();

    // 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.
    int day = 1;
    while (day <= num_days) {

      // Read that day's stock price.
      double price = fin.nextDouble();

      // 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;
      }
      
      day++;
    }

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

    // 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+".");

  }

}
