#include <bits/stdc++.h>
using namespace std;
int h, q, v, e;
string s;
map<int, int> xx;
inline double dfs(int x, int mx) {
  if (xx[x] <= mx) return mx;
  return 0.5 * (dfs(x << 1, max(mx, xx[x] - xx[x << 1])) +
                dfs(x << 1 | 1, max(mx, xx[x] - xx[x << 1 | 1])));
}
int main() {
  scanf("%d%d", &h, &q);
  while (q--) {
    cin >> s;
    if (s[0] == 'a') {
      scanf("%d%d", &v, &e);
      while (v) xx[v] += e, v >>= 1;
    } else
      printf("%.8lf\n", dfs(1, 0));
  }
}
