#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, num = 0, minus, max;
  long long int money = 1000;
  cin >> N;
  std::vector<int> stock(N);
  for (int i = 0; i < N; i++) {
    cin >> stock[i];
  }
  for (int i = 0; i < N - 1; i++) {
    if (stock[i + 1] > stock[i]) {
      num += money / stock[i];
      money = money - num * stock[i];
      cout << "金額:" << money << "  株数" << num << endl;
    } else if (stock[i + 1] < stock[i]) {
      money += num * stock[i];
      num = 0;
      cout << "金額:" << money << "  株数" << num << endl;
    }
  }
  if (num > 0) {
    money += num * stock[N - 1];
    num = 0;
    cout << "金額:" << money << "  株数" << num << endl;
  }
  cout << money << endl;
  return 0;
}
