#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
int n, t, x, a, k = 1, sum[N], seq[N];
long long ans;
int main() {
  cin >> n;
  while (n--) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d %d", &a, &x);
      sum[a] += x;
      ans += x * a;
    } else if (t == 2) {
      scanf("%d", &x);
      seq[++k] = x;
      ans += x;
    } else {
      ans -= seq[k] + sum[k];
      sum[k - 1] += sum[k];
      sum[k--] = 0;
    }
    printf("%0.6f\n", 1.0 * ans / k);
  }
  return 0;
}
