#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
int main() {
  int n, size = 1, arr[200005], arr1[200005];
  long long sum = 0;
  memset(arr, 0, sizeof(arr));
  memset(arr1, 0, sizeof(arr1));
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a == 1) {
      int b, c;
      cin >> b >> c;
      arr[b - 1] += c;
      sum += b * c;
    } else if (a == 2) {
      int b;
      cin >> b;
      arr1[size] = b;
      sum += b;
      size++;
    } else {
      size--;
      sum -= arr1[size];
      arr1[size] = 0;
      sum -= arr[size];
      arr[size - 1] += arr[size];
      arr[size] = 0;
    }
    printf("%.15f\n", 1.0 * sum / size);
  }
  return 0;
}
