#include <bits/stdc++.h>
int num[200100], add[200100], nnum;
int main() {
  long long int sum = 0;
  int a, val, nop, mode, i, j, k;
  scanf("%d", &nop);
  num[0] = 0;
  nnum = 1;
  for (i = 0; i < nop; i++) {
    scanf("%d", &mode);
    if (mode == 1) {
      scanf("%d %d", &a, &val);
      add[a - 1] += val;
      sum += (long long int)val * a;
    } else if (mode == 2) {
      scanf("%d", &a);
      add[nnum] = 0;
      num[nnum++] = a;
      sum += (long long int)a;
    } else if (mode == 3) {
      nnum--;
      sum -= ((long long int)num[nnum] + add[nnum]);
      add[nnum - 1] += add[nnum];
      num[nnum] = 0;
      add[nnum] = 0;
    }
    printf("%.6lf\n", (double)sum / nnum);
  }
  return 0;
}
