#include <bits/stdc++.h>
using namespace std;
map<int, int> s, a;
string str;
double ans;
double dfs(int x, double bi) {
  if (s[x] <= bi)
    return bi;
  else
    return (dfs(x * 2, max(bi, double(s[x * 2 + 1]) + a[x])) +
            dfs(x * 2 + 1, max(bi, double(s[2 * x]) + a[x]))) *
           0.5;
};
int main() {
  int n, m;
  long long v, e;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> str;
    if (str == "add") {
      cin >> v >> e;
      a[v] += e;
      while (v != 0) {
        s[v] += e;
        v = v / 2;
      }
    } else {
      ans = dfs(1, 0);
      printf("%.9f\n", ans);
    }
  }
  return 0;
}
