#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:36777216")
void solve();
int main() {
  solve();
  return 0;
}
int H, Q;
map<int, int> T;
inline int getT(int v) {
  map<int, int>::iterator it = T.find(v);
  return it == T.end() ? 0 : it->second;
}
inline void updateT(int v, int add) {
  while (v > 0) {
    T[v] += add;
    v >>= 1;
  }
}
double f(int v, int h, int m) {
  if (getT(v) <= m) return m;
  int left = getT(v) - getT(2 * v + 1);
  int right = getT(v) - getT(2 * v);
  return 0.5 *
         (f(2 * v, h + 1, max(right, m)) + f(2 * v + 1, h + 1, max(m, left)));
}
char s[100];
void solve() {
  scanf("%d%d", &H, &Q);
  for (int i = 0; i < Q; i++) {
    scanf("%s", s);
    if (s[0] == 'a') {
      int v, e;
      scanf("%d%d", &v, &e);
      updateT(v, e);
    } else {
      printf("%.10lf\n", f(1, 0, 0));
    }
  }
}
