#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
long long offset[N], a[N];
int main() {
  int n;
  cin >> n;
  int i = 1;
  double sum = 0.0, mean;
  a[0] = 0;
  memset(offset, 0, sizeof(offset));
  int type;
  long long k, num;
  while (n--) {
    cin >> type;
    if (type == 1) {
      cin >> num >> k;
      offset[num - 1] += k;
      sum += k * num;
      mean = sum / i;
    } else if (type == 2) {
      cin >> k;
      a[i] = k;
      i++;
      sum += k;
      mean = sum / i;
    } else {
      sum -= a[i - 1];
      if (offset[i - 1] != 0) {
        if ((i - 1) > 0) offset[i - 2] += offset[i - 1];
        sum -= offset[i - 1];
        offset[i - 1] = 0;
      }
      i--;
      mean = sum / i;
    }
    printf("%.8f\n", mean);
  }
  return 0;
}
