#include <bits/stdc++.h>
const int N = 200020;
int n, value[N];
long long delta[N];
int main() {
  scanf("%d", &n);
  long long sum = 0;
  int length = 1;
  while (n--) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int a, x;
      scanf("%d%d", &a, &x);
      sum += (long long)a * x;
      delta[a - 1] += x;
    } else if (type == 2) {
      scanf("%d", value + length);
      delta[length] = 0;
      sum += value[length];
      length++;
    } else {
      length--;
      sum -= value[length] + delta[length];
      delta[length - 1] += delta[length];
      delta[length] = 0;
    }
    printf("%.12lf\n", (double)sum / length);
  }
  return 0;
}
