#include <bits/stdc++.h>
const int MAX = 2e5 + 11;
using namespace std;
int N, A[MAX], B[MAX], cnt = 1;
double cur = 0.0f;
int main() {
  scanf("%d", &(N));
  for (int i = 0; i < (N); ++i) {
    int(t);
    scanf("%d", &t);
    switch (t) {
      case 1: {
        int a, x;
        scanf("%d%d", &a, &x);
        B[a] += x;
        cur += 1LL * a * x;
        break;
      }
      case 2: {
        int(k);
        scanf("%d", &k);
        A[cnt++] = k;
        B[cnt] = 0;
        cur += k;
        break;
      }
      case 3: {
        cur -= A[cnt - 1];
        cur -= B[cnt];
        B[cnt - 1] += B[cnt];
        B[cnt] = 0;
        cnt--;
        break;
      }
    }
    printf("%.6f\n", cur / cnt);
  }
  return 0;
}
