#include <bits/stdc++.h>
using namespace std;
int seq[200005];
int incre[200005];
int main() {
  long long int sum = 0;
  int si = 1;
  int n;
  cin >> n;
  while (n--) {
    int t;
    cin >> t;
    if (t == 1) {
      int a, x;
      cin >> a >> x;
      int i = 0;
      incre[a] += x;
      sum += (1LL * (x * a));
      double ans = (double)sum / si;
      printf("%0.9lf\n", ans);
    } else if (t == 2) {
      int k;
      cin >> k;
      seq[++si] = k;
      sum += k;
      double ans = (double)sum / si;
      printf("%0.9lf\n", ans);
    } else {
      incre[si - 1] += incre[si];
      sum -= incre[si];
      incre[si] = 0;
      sum -= seq[si];
      seq[si] = 0;
      si--;
      double ans = (double)sum / si;
      printf("%0.9lf\n", ans);
    }
  }
}
