#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (ll i = 0; i < (ll)(n); i++) {
    cin >> v[i];
  }
  int stock = 0;
  int money = 1000;
  for (ll i = 0; i < (ll)(n - 1); i++) {
    if (v[i] < v[i + 1]) {
      if (stock == 0) {
        stock = money / v[i];
        money = money % v[i];
      }
    }
    if (v[i] >= v[i + 1]) {
      money += stock * v[i];
      stock = 0;
    }
    cout << money << " " << stock << endl;
  }
  if (stock > 0) {
    money = money + stock * v[n - 1];
  }
  cout << money << endl;
}
