#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int a[N * 2 + 5];
int cnt = 1;
int b[N * 2 + 5];
int main() {
  int T;
  scanf("%d", &T);
  int n, m, k;
  double sum = 0;
  while (T--) {
    scanf("%d", &n);
    if (n == 1) {
      scanf("%d%d", &m, &k);
      a[m] += k;
      sum += m * k;
    } else if (n == 2) {
      scanf("%d", &m);
      b[++cnt] = m;
      sum += m;
    } else {
      a[cnt - 1] += a[cnt];
      sum -= a[cnt] + b[cnt];
      a[cnt] = 0;
      cnt--;
    }
    double M = sum / cnt;
    printf("%.6lf\n", M);
  }
}
