#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  scanf("%d", &N);
  int A[82];
  A[0] = 200;
  for (int i = 1; i < N + 1; i++) {
    scanf("%d", &A[i]);
  }
  A[N + 1] = 100;
  int ans = 1000;
  int num = 0;
  int price = 0;
  for (int i = 1; i <= N; i++) {
    if (A[i - 1] > A[i] && A[i] <= A[i + 1]) {
      num = ans / A[i];
      price = A[i];
    } else if (A[i - 1] < A[i] && A[i] >= A[i + 1]) {
      ans += num * (A[i] - price);
    }
    cout << i << " " << ans << " " << num << " " << price << "\n";
  }
  printf("%d\n", ans);
  return 0;
}
