#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int p) {
  long long int r = 1;
  x = x % p;
  while (y) {
    if (y & 1) r = r * x % p;
    y = y >> 1;
    x = x * x % p;
  }
  return r;
}
int arr[200099];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> v;
  double sum = 0;
  int sz = 0;
  cout << setprecision(10) << fixed;
  v.push_back(0);
  sz++;
  while (n--) {
    int t;
    cin >> t;
    if (t == 1) {
      int a, x;
      cin >> a >> x;
      sum += (a * x);
      arr[a] += x;
      cout << sum / (double)sz << endl;
    }
    if (t == 2) {
      int k;
      cin >> k;
      v.push_back(k);
      sum += k;
      sz++;
      cout << sum / (double)sz << endl;
    }
    if (t == 3) {
      sum = sum - v[v.size() - 1] - arr[sz];
      arr[sz - 1] += arr[sz];
      arr[sz] = 0;
      v.pop_back();
      sz--;
      cout << sum / (double)sz << endl;
    }
  }
}
