#include <bits/stdc++.h>
using namespace std;
int m, n, x, y, z;
long long a[1 << 19], b[1 << 19], res;
inline void print() {
  double rs = (double)res / (double)n;
  printf("%.15lf\n", rs);
}
int main() {
  memset(a, 0, sizeof a);
  scanf("%d", &m);
  n = 0;
  b[n++] = 0;
  while (m--) {
    scanf("%d", &x);
    if (x == 1) {
      scanf("%d%d", &y, &z);
      a[y] += z;
      res += (long long)y * z;
      print();
      continue;
    }
    if (x == 2) {
      scanf("%d", &y);
      b[n++] = y;
      res += y;
      print();
      continue;
    }
    if (x == 3) {
      res -= a[n] * (long long)n;
      res += a[n] * (long long)(n - 1);
      a[n - 1] += a[n];
      a[n] = 0;
      res -= b[--n];
      print();
      continue;
    }
  }
  return 0;
}
