#include <bits/stdc++.h>
using namespace std;
double a[1000000], b[1000000];
int main() {
  int i, h, k = 0, n, m = 1, p = 0, l, x, t, j;
  double s = 0;
  cin >> n;
  while (n--) {
    cin >> t;
    if (t == 1) {
      cin >> x >> j;
      s += (double)(x * j);
      a[x - 1] += j;
      if (x > m) m = x;
      printf("%.6lf\n", s / (double)m);
    } else if (t == 2) {
      cin >> x;
      s += (double)x;
      b[m++] = x;
      printf("%.6lf\n", s / (double)m);
    } else if (t == 3) {
      if (m >= 2) {
        s -= (double)(b[m - 1] + a[m - 1]);
        a[m - 2] += a[m - 1];
        b[m - 1] = 0;
        a[m - 1] = 0;
        m--;
      }
      printf("%.6lf\n", s / (double)m);
    }
  }
  return 0;
}
