#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
int que[maxn];
int vis[maxn];
int dat[maxn];
int main() {
  int n;
  scanf("%d", &n);
  long long sum = 0;
  int len = 1;
  for (int i = 1; i <= n; i++) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int r, v;
      scanf("%d%d", &r, &v);
      sum += 1.0 * r * v;
      vis[r] += v;
    } else if (op == 2) {
      int v;
      scanf("%d", &v);
      que[++len] = v;
      sum += v;
    } else if (op == 3 && len != 0) {
      sum -= vis[len];
      sum -= que[len];
      vis[len - 1] += vis[len];
      vis[len] = 0;
      len--;
    }
    double ans = (double)sum / (len);
    printf("%.8lf\n", ans);
  }
}
