#include <bits/stdc++.h>
using namespace std;
inline int rdi() {
  int d;
  scanf("%d", &d);
  return d;
}
inline char rdc() {
  scanf(" ");
  return getchar();
}
inline string rds() {
  string s;
  cin >> s;
  return s;
}
inline double rddb() {
  double d;
  scanf("%lf", &d);
  return d;
}
template <class T>
inline bool updateMin(T& a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
inline bool updateMax(T& a, T b) {
  return a < b ? a = b, true : false;
}
const int N = 262144;
long long s;
int n, a[N], d[N];
int main() {
  for (int repp_b = (rdi()), repp = 0; repp < repp_b; ++repp) {
    int op = rdi();
    if (op == 1) {
      int i = rdi(), add = rdi();
      d[i - 1] += add;
      s += (long long)i * add;
    } else if (op == 2) {
      int end = rdi();
      ++n;
      a[n] = end;
      d[n] = 0;
      s += end;
    } else {
      d[n - 1] += d[n];
      s -= a[n] + d[n];
      --n;
    }
    printf("%f\n", s / (n + 1.0));
  }
  return 0;
}
