#include <bits/stdc++.h>
using namespace std;
ifstream fin("in.in");
ofstream fout("out.out");
const int H = 30 + 10;
int height, q, n, pw[H];
struct tree {
  int par, left, right, id, e;
  tree() {
    par = left = right = id = -1;
    e = 0;
  }
};
vector<tree> node;
inline void makeLeftChild(int v) {
  n++;
  node.push_back(tree());
  node[v].left = n;
  node[n].par = v;
}
inline void makeRightChild(int v) {
  n++;
  node.push_back(tree());
  node[v].right = n;
  node[n].par = v;
}
inline void add(int u, int e) {
  int v = 0, x = 1, h = log2(u) - 1;
  for (; x != u; h--) {
    node[v].e += e;
    if (pw[h] & u) {
      if (node[v].right == -1) makeRightChild(v);
      v = node[v].right;
      x = 2 * x + 1;
    } else {
      if (node[v].left == -1) makeLeftChild(v);
      v = node[v].left;
      x = 2 * x + 0;
    }
  }
  node[v].e += e;
}
double calc(int u, int maxE, int h) {
  if (!node[u].e || h == height) return max(maxE, node[u].e);
  if (node[u].left == -1) makeLeftChild(u);
  int right = node[u].e - node[node[u].left].e;
  if (node[u].right == -1) makeRightChild(u);
  int left = node[u].e - node[node[u].right].e;
  double ret = max(maxE, max(left, right));
  if (left < right)
    ret += calc(node[u].right, max(maxE, left), h + 1);
  else
    ret += calc(node[u].left, max(maxE, right), h + 1);
  return ret / 2;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> height >> q;
  for (int i = 0; i <= height + 1; i++) pw[i] = 1 << i;
  node.push_back(tree());
  cout << setprecision(10) << fixed;
  while (q--) {
    string ord;
    cin >> ord;
    if (ord == "decay")
      cout << calc(0, 0, 0) << endl;
    else {
      int u, e;
      cin >> u >> e;
      add(u, e);
    }
  }
  return 0;
}
