#include <bits/stdc++.h>
using namespace std;
long double T, chk[200001], x, z, arr[200001], ret;
int siz = 1, y;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> T;
  cout << fixed;
  cout.precision(12);
  while (T--) {
    cin >> x;
    if (x == 1) {
      cin >> y >> z;
      chk[y] += z;
      ret += y * z;
    } else if (x == 2) {
      cin >> y;
      ret += y;
      siz++;
      arr[siz - 1] = y;
    } else if (x == 3) {
      ret -= (arr[siz - 1] + chk[siz]);
      arr[siz - 1] = 0;
      chk[siz - 1] += chk[siz];
      chk[siz] = 0;
      siz--;
    }
    cout << ret / siz << "\n";
  }
}
