#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100005, MaxD = 32, MaxBuf = 128, MaxC = 0x3F3F3F3F, NA = -1;
struct node {
  int s1, s2, p, val, sum;
  node(int np) {
    s1 = s2 = NA;
    p = np;
    val = sum = 0;
  }
  node(void) {}
};
node t[MaxN * MaxD];
char buf[MaxBuf];
int n;
double f(int v, double m) {
  if (t[v].s1 == NA) return max(m, (double)t[v].val);
  if (t[t[v].s1].sum >= t[t[v].s2].sum)
    return 0.5 * (max(m, (double)t[v].val + t[t[v].s1].sum) +
                  f(t[v].s1, max(m, (double)t[v].val + t[t[v].s2].sum)));
  else
    return 0.5 * (max(m, (double)t[v].val + t[t[v].s2].sum) +
                  f(t[v].s2, max(m, (double)t[v].val + t[t[v].s1].sum)));
}
int main(void) {
  int d, e, h, i, k, q, v, r;
  while (scanf(" %d %d", &h, &q) != EOF) {
    n = 0;
    t[n++] = node(NA);
    for (i = 0; i < q; i++) {
      scanf(" %s", buf);
      if (!strcmp(buf, "add")) {
        scanf(" %d %d", &v, &e);
        k = 1;
        d = 0;
        for (r = 1; r < v; r = (r << 1) + 1)
          ;
        for (r -= (r >> 1), r >>= 1; r > 0; r >>= 1) {
          if (t[d].s1 == NA) {
            t[n] = node(d);
            t[d].s1 = n;
            n++;
            t[n] = node(d);
            t[d].s2 = n;
            n++;
          }
          k <<= 1;
          if (v & r) {
            k++;
            d = t[d].s2;
          } else {
            d = t[d].s1;
          }
          assert(d != NA);
        }
        assert(k == v);
        t[d].val += e;
        while (d != NA) {
          t[d].sum += e;
          d = t[d].p;
        }
      } else if (!strcmp(buf, "decay")) {
        printf("%.10lf\n", f(0, 0));
      } else
        assert(false);
    }
  }
  return 0;
}
