#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200010;
const int INF = 1 << 28;
int n, m;
long long sum;
int a[MAX_N];
long long b[MAX_N];
void solve() {
  m = 1;
  a[0] = 0;
  sum = 0;
  for (int i = (0); i < (n); i++) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int j, x;
      scanf("%d%d", &j, &x);
      b[j - 1] += x;
      sum += x * j;
    } else if (t == 2) {
      int k;
      scanf("%d", &k);
      a[m++] = k;
      sum += k;
    } else if (t == 3) {
      m--;
      sum -= a[m] + b[m];
      b[m - 1] += b[m];
      b[m] = 0;
    }
    printf("%.6lf\n", (double)sum / m);
  }
}
int main() {
  scanf("%d", &n);
  solve();
  return 0;
}
