#include <bits/stdc++.h>
using namespace std;
const int MX = 100000;
const long long MOD = 1000000007;
const int base = 131;
long long fast_exp(long long base, long long exp, long long mod) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % mod;
    base = (base * base) % mod;
    exp /= 2;
  }
  return res;
}
long long dp[3 * MX];
int main() {
  int n, t, a, x, k;
  cin >> n;
  vector<int> seq;
  seq.push_back(0);
  long long sum = 0;
  memset(dp, 0, sizeof(dp));
  ;
  for (int i = 0, _i = (n); i < _i; ++i) {
    cin >> t;
    if (t == 1) {
      cin >> a >> x;
      dp[a - 1] += x;
      sum += a * x;
    } else if (t == 2) {
      cin >> k;
      seq.push_back(k);
      sum += k;
    } else if (t == 3 && seq.size() >= 2) {
      sum -= (seq[seq.size() - 1] + dp[seq.size() - 1]);
      dp[seq.size() - 2] += dp[seq.size() - 1];
      dp[seq.size() - 1] = 0;
      seq.pop_back();
    }
    printf("%.6lf\n", 1.0 * sum / seq.size());
  }
  return 0;
}
