#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int maxint = 2139062143;
const int N = 2e5 + 5;
int n;
int an[N], bn[N];
bool cnnn[N];
int main() {
  memset(an, 0, sizeof(an));
  memset(bn, 0, sizeof(bn));
  memset(cnnn, false, sizeof(cnnn));
  scanf("%d", &n);
  int t = n;
  long long sum = 0;
  int all = 1;
  an[all] = 0;
  while (t--) {
    int a;
    scanf("%d", &a);
    if (a == 1) {
      int b, c;
      scanf("%d%d", &b, &c);
      bn[b] += c;
      cnnn[b] = 1;
      sum += b * c;
    }
    if (a == 2) {
      int b;
      scanf("%d", &b);
      an[++all] = b;
      sum += b;
    }
    if (a == 3) {
      sum -= an[all--];
      if (cnnn[all + 1] == 1) {
        sum -= bn[all + 1];
        cnnn[all + 1] = 0;
        cnnn[all] = 1;
        bn[all] += bn[all + 1];
        bn[all + 1] = 0;
      }
    }
    printf("%.8lf\n", double(sum) / double(all));
  }
  return 0;
}
