#include <bits/stdc++.h>
using namespace std;
long long int read_int() {
  char r;
  bool start = false, neg = false;
  long long int ret = 0;
  while (true) {
    r = getchar();
    if ((r - '0' < 0 || r - '0' > 9) && r != '-' && !start) {
      continue;
    }
    if ((r - '0' < 0 || r - '0' > 9) && r != '-' && start) {
      break;
    }
    if (start) ret *= 10;
    start = true;
    if (r == '-')
      neg = true;
    else
      ret += r - '0';
  }
  if (!neg)
    return ret;
  else
    return -ret;
}
int main(void) {
  long long n;
  cin >> n;
  int i, t, x, a, k;
  stack<long long> actualNum;
  vector<long long> sumTillHere(200005, 0);
  vector<long long> lastAdded(200005, 0);
  actualNum.push(0);
  sumTillHere[0] = 0;
  lastAdded[0] = 0;
  double res = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &t);
    double size = actualNum.size();
    long long sum = 0;
    switch (t) {
      case 1:
        scanf("%d%d", &a, &x);
        lastAdded[a - 1] += x;
        sumTillHere[size - 1] += x * a;
        res = sumTillHere[size - 1] / size;
        break;
      case 2:
        scanf("%d", &k);
        actualNum.push(k);
        sum = sumTillHere[size - 1];
        sumTillHere[size] = sum + k;
        lastAdded[size] = 0;
        res = (sumTillHere[size]) / (size + 1);
        break;
      case 3:
        if (size > 1) {
          long long topEle = actualNum.top();
          actualNum.pop();
          lastAdded[size - 2] += lastAdded[size - 1];
          sumTillHere[size - 1] -= (topEle + lastAdded[size - 1]);
          res = sumTillHere[size - 2] = sumTillHere[size - 1];
          res /= (size - 1);
        } else {
          res = sumTillHere[size - 1] / size;
        }
        break;
    }
    printf("%.6lf\n", res);
  }
  return 0;
}
