#include <bits/stdc++.h>
using namespace std;
using namespace std;
int h, q;
map<int, int> mp;
inline int read() {
  int s = 0, w = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') w = -1;
  for (; isdigit(c); c = getchar()) s = (s << 1) + (s << 3) + (c ^ 48);
  return s * w;
}
double dfs(int u, int Max) {
  if (Max >= mp[u]) return Max;
  return 0.5 * (dfs(u << 1, max(Max, mp[u] - mp[u << 1])) +
                dfs(u << 1 | 1, max(Max, mp[u] - mp[u << 1 | 1])));
}
int main() {
  h = read(), q = read();
  while (q--) {
    char c[10];
    scanf("%s", c);
    if (c[0] == 'a') {
      int u = read(), w = read();
      while (u) mp[u] += w, u >>= 1;
    } else
      printf("%.8f\n", dfs(1, 0));
  }
  return 0;
}
