#include <bits/stdc++.h>
using namespace std;
long long nums[200001];
long long extra[200001];
int main() {
  ios_base::sync_with_stdio(false);
  cout.precision(30);
  int q;
  cin >> q;
  int len = 1;
  long long sum = 0;
  ostringstream sstr;
  sstr.precision(30);
  for (int i = 0; i < q; ++i) {
    int type;
    cin >> type;
    if (type == 1) {
      long long a, x;
      cin >> a >> x;
      extra[a - 1] += x;
      sum += (a * x);
    }
    if (type == 2) {
      int a;
      cin >> a;
      nums[len++] = a;
      sum += a;
    }
    if (type == 3) {
      sum -= (nums[len - 1] + extra[len - 1]);
      extra[len - 2] += extra[len - 1];
      extra[len - 1] = 0;
      --len;
    }
    double avg = sum * 1.0 / len;
    sstr << avg << '\n';
  }
  cout << sstr.str();
  return 0;
}
