#include <bits/stdc++.h>
using namespace std;
const long long MX = 3e5 + 9;
const long double pi = acos(-1);
const long long mod = 1e9 + 7;
bool cmp(int a, int b) { return a > b; }
long long po(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  long long x = po(a, b / 2);
  x *= x % mod;
  if (b % 2) {
    x *= a % mod;
  }
  return x % mod;
}
int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b)); }
vector<int> v;
long long last[MX], a[MX];
int main() {
  int n, sz = 1;
  scanf("%d", &n);
  long long sum = 0;
  long double ans = 0;
  v.push_back(0);
  for (int i = 0; i < n; i++) {
    int cmd;
    scanf("%d", &cmd);
    if (cmd == 1) {
      int x, m;
      scanf("%d %d", &x, &m);
      last[x - 1] += m;
      sum += x * m;
    } else if (cmd == 2) {
      int k;
      scanf("%d", &k);
      a[sz++] = k;
      sum += k;
    } else if (cmd == 3) {
      sz--;
      sum -= (last[sz] + a[sz]);
      last[sz - 1] += last[sz];
      last[sz] = 0;
    }
    printf("%.9lf\n", (double)sum / sz);
  }
  return 0;
}
