#include <bits/stdc++.h>
using namespace std;
const int H = 32, Q = 100010;
struct node {
  node *l, *r;
  double val;
} root[H * Q], *nodes = root + 1;
double calc(node *u, double mx) {
  if (!u || u->val <= mx) return mx;
  return (calc(u->l, max(mx, u->val - (u->l ? u->l->val : 0))) +
          calc(u->r, max(mx, u->val - (u->r ? u->r->val : 0)))) /
         2;
}
int q, h, v, e;
char s[10];
int main() {
  for (scanf("%d %d", &h, &q); q--;) {
    scanf("%s", s);
    if (s[0] == 'a') {
      scanf("%d %d", &v, &e);
      node *u = root;
      u->val += e;
      for (int t = 31 - __builtin_clz(v); t--;) {
        if (v >> t & 1) {
          if (!u->l) u->l = nodes++;
          u = u->l;
        } else {
          if (!u->r) u->r = nodes++;
          u = u->r;
        }
        u->val += e;
      }
    } else
      printf("%lf\n", calc(root, 0));
  }
}
