#include <bits/stdc++.h>
using namespace std;
long long a[2000500];
long long b[2000200];
int main() {
  long long int n, m, s, t;
  long long int k, sum;
  while (cin >> n) {
    long long ans = 0, cnt = 0;
    sum = 1;
    b[1] = 0;
    for (int i = 1; i <= n; i++) {
      cin >> k;
      if (k == 1) {
        cin >> s >> t;
        a[s] += t;
        ans += s * t;
      } else if (k == 2) {
        cin >> t;
        b[++sum] = t;
        ans += t;
      } else if (k == 3) {
        ans -= (b[sum] + a[sum]);
        a[sum - 1] += a[sum];
        a[sum] = 0;
        sum--;
      }
      printf("%.6f\n", ans * 1.0 / sum);
    }
  }
}
