#include <stdio.h>

void main(){
    int N,A[80],a;
    long long G = 1000;
    scanf("%d",&N);
    for(int i = 0;i < N;i++){
        scanf("%d",A+i);
    }

    for(int i = 0;i < N-1;i++){
        if(A[i] < A[i+1]){
            a = G/A[i];
            G = G%A[i];
            printf("購入数 %d 所持金 %lld\n",a,G);
            G = G + a*A[i+1];
            printf("%lld\n",G);
        }
    }
    printf("%lld\n",G);
}