#include <bits/stdc++.h>
using namespace std;
map<int, int> mp1, mp2;
int h, q;
char s[10];
double dfs(int dep, int x, int V) {
  if (V >= mp2[x]) return V;
  if (dep == h) return mp1[x];
  return (dfs(dep + 1, 2 * x, max(V, mp1[x] + mp2[2 * x + 1])) +
          dfs(dep + 1, 2 * x + 1, max(V, mp1[x] + mp2[2 * x]))) /
         2.0;
}
int main() {
  scanf("%d%d", &h, &q);
  while (q--) {
    scanf("%s", s);
    if (s[0] == 'a') {
      int v, e;
      scanf("%d%d", &v, &e);
      mp1[v] += e;
      while (v) {
        mp2[v] += e;
        v /= 2;
      }
    } else
      printf("%.9f\n", dfs(0, 1, 0));
  }
}
