#include <bits/stdc++.h>
using namespace std;
struct data {
  data *l, *r;
  int sts, br;
  data() {
    l = r = 0;
    br = sts = 0;
  }
};
void update(data *w) {
  if (w == NULL) return;
  w->sts = w->br;
  if (w->l != NULL) w->sts += w->l->sts;
  if (w->r != NULL) w->sts += w->r->sts;
}
data *root = new data();
deque<int> path;
void add(data *V, int p, int how) {
  if (p == path.size()) {
    V->br += how;
    update(V);
    return;
  }
  if (!path[p]) {
    if (V->l == NULL) V->l = new data();
    add(V->l, p + 1, how);
  } else {
    if (V->r == NULL) V->r = new data();
    add(V->r, p + 1, how);
  }
  update(V);
}
void PUSH(int P, int HOW) {
  path.clear();
  while (P > 1) {
    path.push_front(P % 2);
    P >>= 1;
  }
  add(root, 0, HOW);
}
double mat_oj(data *V, double prob, int BIG) {
  if (V == NULL) return BIG * prob;
  if (V->l == NULL && V->r == NULL) return max(V->sts, BIG) * prob;
  int SL = V->br, SR = V->br;
  if (V->l != NULL) SL += V->l->sts;
  if (V->r != NULL) SR += V->r->sts;
  if (SL == SR) return max(BIG, SL) * prob;
  if (SL < SR) {
    double ret = (max(SR, BIG) * prob) / 2;
    return ret + mat_oj(V->r, prob / 2, max(BIG, SL));
  } else {
    double ret = (max(SL, BIG) * prob) / 2;
    return ret + mat_oj(V->l, prob / 2, max(BIG, SR));
  }
}
int main() {
  int i, j, lev, Q;
  char BUF[30];
  scanf("%d%d", &lev, &Q);
  while (Q-- > 0) {
    scanf("%s", &BUF);
    if (BUF[0] == 'd')
      printf("%.12lf\n", mat_oj(root, 1, 0));
    else {
      scanf("%d%d", &i, &j);
      PUSH(i, j);
    }
  }
  return 0;
}
