#include <bits/stdc++.h>
using namespace std;
const int MAX = 300000;
long long sum[MAX], arr[MAX];
int main() {
  int n;
  cin >> n;
  long long now = 0;
  int tam = 1;
  int t, a, x;
  memset(sum, 0, sizeof(sum));
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (t == 1) {
      cin >> a >> x;
      sum[a - 1] += x;
      now += (a * x);
    }
    if (t == 2) {
      cin >> a;
      arr[tam] = a;
      tam++;
      now += a;
    }
    if (t == 3) {
      tam--;
      now -= arr[tam];
      now -= sum[tam];
      sum[tam - 1] += sum[tam];
      sum[tam] = 0;
    }
    printf("%.9lf\n", ((now * 1.0) / (tam * 1.0)));
  }
  return 0;
}
