#include <bits/stdc++.h>
using namespace std;
int h, q;
char op[100];
map<int, int> m;
double calc(int nod, int valMax, double prob) {
  if (nod >= (1 << h)) return max(m[nod], valMax) * prob;
  int sumL = m[nod] - m[2 * nod + 1], sumR = m[nod] - m[2 * nod];
  double rez = 0;
  if (sumL < sumR) {
    rez += 0.5 * prob * max(valMax, sumR);
    rez += calc(2 * nod + 1, max(valMax, sumL), prob * 0.5);
  } else {
    rez += 0.5 * prob * max(valMax, sumL);
    rez += calc(2 * nod, max(valMax, sumR), prob * 0.5);
  }
  return rez;
}
int main() {
  int i;
  cin >> h >> q;
  for (i = 1; i <= q; ++i) {
    cin >> op;
    if (op[0] == 'a') {
      int v, e;
      cin >> v >> e;
      while (v) {
        m[v] += e;
        v /= 2;
      }
    } else
      printf("%.6lf\n", calc(1, 0, 1));
  }
  return 0;
}
