#include <bits/stdc++.h>
using namespace std;
class TreeNode {
  int i;
  long long sum;
  TreeNode *lchild, *rchild;

 public:
  TreeNode(int _i, int _s = 0) {
    i = _i;
    sum = _s;
    lchild = rchild = NULL;
  }
  ~TreeNode() {
    if (lchild) delete lchild;
    if (rchild) delete rchild;
  }
  TreeNode* left() {
    if (lchild == NULL) lchild = new TreeNode(i * 2, 0);
    return lchild;
  }
  TreeNode* right() {
    if (rchild == NULL) rchild = new TreeNode(i * 2 + 1, 0);
    return rchild;
  }
  void add(int path[], int pn, int pi, long long e) {
    sum += e;
    if (pi < pn) {
      if (path[pi] & 1) {
        right()->add(path, pn, pi + 1, e);
      } else {
        if (lchild == NULL) lchild = new TreeNode(i * 2, 0);
        left()->add(path, pn, pi + 1, e);
      }
    }
  }
  double gao(long long e) {
    if (sum <= e) return e;
    double ret = 0.0;
    ret += 0.5 * left()->gao(max(e, sum - left()->sum));
    ret += 0.5 * right()->gao(max(e, sum - right()->sum));
    return ret;
  }
};
inline int getPath(int i, int path[]) {
  int pn = 0;
  while (i > 1) {
    path[pn++] = i;
    i = i >> 1;
  }
  reverse(path, path + pn);
  return pn;
}
int main() {
  char o[16];
  int h, q, v, e, pn, path[32];
  while (scanf("%d%d", &h, &q) != EOF) {
    TreeNode* root = new TreeNode(1, 0);
    while (q--) {
      scanf("%s", o);
      if (!strcmp(o, "decay")) {
        printf("%.12lf\n", root->gao(0));
      } else {
        scanf("%d%d", &v, &e);
        pn = getPath(v, path);
        root->add(path, pn, 0, e);
      }
    }
    delete root;
  }
  return 0;
}
