#include <bits/stdc++.h>
using namespace std;
long long ar[2 * 100000 + 10];
long long add[2 * 100000 + 10];
long long ans;
int main() {
  long long i, j, k, l, num, m, n;
  cin >> num;
  ans = 0;
  ar[1] = 0;
  long long indx = 2;
  for (i = 0; i < num; i++) {
    cin >> j;
    if (j == 1) {
      cin >> k >> l;
      add[k] += l;
      ans = ans + (k * l);
    } else if (j == 2) {
      cin >> k;
      ar[indx++] = k;
      ans = ans + k;
    } else if (j == 3) {
      ans = ans - ar[indx - 1] - add[indx - 1];
      add[indx - 2] = add[indx - 2] + add[indx - 1];
      indx--;
      add[indx] = 0;
    }
    if (indx > 1)
      printf("%.12lf\n", (ans * 1.0) / (indx - 1));
    else
      printf("%.12lf\n", ans * 1.0);
  }
  return 0;
}
