#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long money = 1000, kabu = 0;
  for (int i = 0; i < n - 1; i++) {
    if (kabu == 0 && a[i] < a[i + 1]) {
      kabu = floor(money / a[i]);
      money -= kabu * a[i];
    }
    if (kabu != 0 && a[i] > a[i + 1]) {
      money += kabu * a[i];
      kabu = 0;
    }
    cout << money << " " << kabu << endl;
  }
  money += kabu * a[n - 1];
  cout << money << endl;
  return 0;
}
