#include <bits/stdc++.h>
using namespace std;
struct node {
  long long val, sum;
};
node nodes[(1 << 19)];
void update(int ni, int ns, int ne, int qs, int qe, long long val) {
  if (qe < ns || qs > ne) return;
  node &n = nodes[ni];
  if (ns >= qs && ne <= qe) {
    n.val += val;
    n.sum += val * (ne - ns + 1);
    return;
  }
  int lf = ni * 2 + 1, rt = lf + 1, md = ns + ((ne - ns) / 2);
  update(lf, ns, md, qs, qe, val);
  update(rt, md + 1, ne, qs, qe, val);
  n.sum = n.val * (ne - ns + 1) + nodes[lf].sum + nodes[rt].sum;
}
long long query(int ni, int ns, int ne, int qs, int qe) {
  if (qe < ns || qs > ne) return 0ll;
  node &n = nodes[ni];
  if (ns >= qs && ne <= qe) {
    return n.sum;
  }
  int lf = ni * 2 + 1, rt = lf + 1, md = ns + ((ne - ns) / 2);
  long long res = query(lf, ns, md, qs, qe);
  res += query(rt, md + 1, ne, qs, qe);
  res += (min(ne, qe) - max(ns, qs) + 1) * n.val;
  return res;
}
int main() {
  int n;
  cin >> n;
  int t;
  int s = 1;
  int N = 2e5 + 1;
  for (int i = 0; i < (int)n; i++) {
    cin >> t;
    if (t == 1) {
      int x, a;
      cin >> a >> x;
      update(0, 1, N, 1, a, x);
    } else if (t == 2) {
      int k;
      cin >> k;
      s++;
      update(0, 1, N, s, s, k);
    } else {
      long long l = query(0, 1, N, s, s);
      update(0, 1, N, s, s, -l);
      s--;
    }
    long long res = query(0, 1, N, 1, s);
    printf("%.6lf\n", (double)res / (double)s);
  }
  return 0;
}
