#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long int power(long long int x, long long int y,
                    long long int m = 1000000007) {
  long long int ans = 1;
  x %= m;
  while (y) {
    if (y & 1) ans = (x * ans) % m;
    x = (x * x) % m;
    y >>= 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<long long int> c(n + 1), v(2, 0);
  long long int avg = 0;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    if (p == 1) {
      int a, x;
      cin >> a >> x;
      avg += a * x;
      c[a] += x;
    }
    if (p == 2) {
      int a;
      cin >> a;
      v.push_back(a);
      avg += a;
    }
    if (p == 3) {
      avg -= (v.back() + c[v.size() - 1]);
      c[v.size() - 2] += c[v.size() - 1];
      c[v.size() - 1] = 0;
      v.pop_back();
    }
    cout << fixed << setprecision(10) << ((float)avg) / ((float)(v.size() - 1))
         << "\n";
  }
  return 0;
}
