#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60000000")
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = (1 << 31) - 1;
const long long LLINF = ((long long)1 << 62) - 1;
const long long maxn = 200010;
int n;
long long a[maxn], tree[4 * maxn], add[4 * maxn];
void PushUp(int vertex) {
  tree[vertex] = tree[vertex * 2] + tree[vertex * 2 + 1];
}
void PushDown(int vertex, int l, int r) {
  if (add[vertex]) {
    add[vertex * 2] += add[vertex];
    add[vertex * 2 + 1] += add[vertex];
    tree[vertex * 2] += add[vertex] * 1LL * ((l + r) / 2 - l + 1);
    tree[vertex * 2 + 1] += add[vertex] * 1LL * (r - ((l + r) / 2 + 1) + 1);
    add[vertex] = 0;
  }
}
void addSegment(int L, int R, int val, int l, int r, int vertex) {
  if (L <= l && r <= R) {
    add[vertex] += val;
    tree[vertex] += val * 1LL * (r - l + 1);
  } else {
    PushDown(vertex, l, r);
    int m = (l + r) >> 1;
    if (L <= m) addSegment(L, R, val, l, m, vertex * 2);
    if (m < R) addSegment(L, R, val, m + 1, r, vertex * 2 + 1);
    PushUp(vertex);
  }
}
void assignSegment(int L, int R, int val, int l, int r, int vertex) {
  if (L <= l && r <= R) {
    add[vertex] = 0;
    tree[vertex] = val;
  } else {
    PushDown(vertex, l, r);
    int m = (l + r) >> 1;
    if (L <= m) assignSegment(L, R, val, l, m, vertex * 2);
    if (m < R) assignSegment(L, R, val, m + 1, r, vertex * 2 + 1);
    PushUp(vertex);
  }
}
long long get(int L, int R, int l, int r, int vertex) {
  if (L <= l && r <= R) return tree[vertex];
  PushDown(vertex, l, r);
  int m = (l + r) >> 1;
  long long res = 0;
  if (L <= m) res += get(L, R, l, m, vertex * 2);
  if (m < R) res += get(L, R, m + 1, r, vertex * 2 + 1);
  return res;
}
int main() {
  int cnt = 1;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int command;
    scanf("%d", &command);
    if (command == 1) {
      int ai, x;
      scanf("%d%d", &ai, &x);
      addSegment(1, ai, x, 1, n + 1, 1);
    } else {
      if (command == 2) {
        int k;
        cnt++;
        scanf("%d", &k);
        assignSegment(cnt, cnt, k, 1, n + 1, 1);
      } else {
        assignSegment(cnt, cnt, 0, 1, n + 1, 1);
        cnt--;
      }
    }
    printf("%.7lf\n", (long double)get(1, cnt, 1, n + 1, 1) / cnt);
  }
  return 0;
}
