#include <bits/stdc++.h>
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
using namespace std;
int ar[300000];
int save[300000];
int main() {
  int t, ind = 1;
  long long sum = 0;
  cin >> t;
  while (t--) {
    int type;
    cin >> type;
    switch (type) {
      case 1:
        int a, x;
        cin >> a >> x;
        save[a - 1] += x;
        sum += a * x;
        break;
      case 2:
        int k;
        cin >> k;
        ar[ind++] = k;
        sum += k;
        break;
      case 3:
        sum -= save[ind - 1];
        save[ind - 2] += save[ind - 1];
        save[ind - 1] = 0;
        sum -= ar[ind - 1];
        ind--;
    }
    double avg = (double)sum / ind;
    printf("%.7f\n", avg);
  }
  return 0;
}
