#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  int a = 1000;
  int b = 1000 / v[0];
  int amari = 1000 % v[0];
  bool flag = false;
  for (int i = 1; i < n; i++) {
    cout << a << "\n" << b << "\n";
    if (a + amari < v[i] * b) {
      a = v[i] * b;
      flag = true;
    }
    if (b < a + amari / v[i]) {
      b = (a + amari) / v[i];
      amari = (a + amari) - v[i] * b;
    }
  }
  if (flag) {
    cout << a + amari << "\n";
  } else {
    cout << 1000 << "\n";
  }
}
