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