#include <bits/stdc++.h>
using namespace std;
long long val[200020] = {0};
long long offset[200020] = {0};
long long sum = 0;
int main() {
  int n;
  while (scanf("%d", &n) > 0) {
    int cmd;
    long long a, x, k;
    int count = 1;
    count = 1;
    sum = 0;
    offset[0] = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &cmd);
      switch (cmd) {
        case 1:
          scanf("%I64d%I64d", &a, &x);
          offset[a - 1] += x;
          sum += a * x;
          printf("%.6f\n", (double)sum / count);
          break;
        case 2:
          scanf("%I64d", &k);
          val[count++] = k;
          sum += k;
          printf("%.6f\n", (double)sum / count);
          break;
        case 3:
          count--;
          offset[count - 1] += offset[count];
          sum -= val[count] + offset[count];
          offset[count] = 0;
          printf("%.6f\n", (double)sum / count);
          break;
        default:
          break;
      }
    }
  }
  return 0;
}
