#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int64_t> A = {500};
  for (int i = 0; i < (int)(N); i++) {
    int64_t a;
    cin >> a;
    if (a != A.back()) A.push_back(a);
  }
  A.push_back(0);
  N = A.size() - 2;
  int64_t money = 1000, kabu = 0;
  for (int i = 1; i <= (int)(N); i++) {
    cout << A[i] << endl;
    if (A[i - 1] < A[i] && A[i] > A[i + 1]) {
      money += kabu * A[i];
      kabu = 0;
    }
    if (A[i - 1] > A[i] && A[i] < A[i + 1]) {
      kabu += money / A[i];
      money -= kabu * A[i];
    }
  }
  cout << money << endl;
}
