#include <bits/stdc++.h>
using namespace std;
int h, q, v, e;
string str;
map<int, int> c, s;
double dp(int x, double now) {
  if (s[x] <= now) return now;
  return (dp(x + x, max(now, (double)c[x] + s[x + x + 1])) +
          dp(x + x + 1, max(now, (double)c[x] + s[x + x]))) /
         2;
}
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(8);
  for (cin >> h >> q; q; q--) {
    cin >> str;
    if (str == "decay") {
      cout << dp(1, 0) << endl;
    } else {
      cin >> v >> e;
      c[v] += e;
      for (; v; v >>= 1) s[v] += e;
    }
  }
}
