#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
template <class T, class U>
inline void cmax(T &a, U b) {
  if (a < b) a = b;
}
template <class T, class U>
inline void cmin(T &a, U b) {
  if (a > b) a = b;
}
constexpr char el = '\n';
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.first << " " << p.second;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (ll i = 0; i < (ll)v.size(); i++)
    os << v[i] << (i + 1 != v.size() ? " " : "");
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &i : v) is >> i;
  return is;
}
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cerr << fixed << setprecision(15);
  }
} io_setup;
int main() {
  ll n;
  cin >> n;
  vl a(n);
  cin >> a;
  vl dp(n + 1);
  dp[0] = 1000;
  for (ll i = 0; i < (ll)n; i++) {
    dp[i + 1] = dp[i];
    for (ll j = 0; j < (ll)i; j++) {
      ll cnt = dp[j + 1] / a[j];
      cmax(dp[i + 1], dp[j + 1] - cnt * a[j] + cnt * a[i]);
    }
  }
  cout << dp << el;
  cout << dp[n] << el;
}
