#include <bits/stdc++.h>
using namespace std;
int h, n;
double res = 0;
string s;
map<int, int> m;
map<int, int> w;
void f(long long root, double curP, int maxV) {
  int L, R;
  if (1LL * root + 1LL * root >= (1LL << (h + 1))) {
    res += curP * max(maxV, w[root]);
    return;
  }
  L = w[root] + m[root * 2];
  R = w[root] + m[root + root + 1];
  if (L == R) {
    res += curP * max(R, maxV);
    return;
  }
  if (L < R) {
    res += curP * 0.5 * max(R, maxV);
    f(root * 2 + 1, curP * 0.5, max(maxV, L));
    return;
  }
  res += curP * 0.5 * max(L, maxV);
  f(root * 2, curP * 0.5, max(maxV, R));
}
int main() {
  ios::sync_with_stdio(false);
  cin >> h >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "decay") {
      res = 0.0;
      f(1, 1, 0);
      cout.precision(15);
      cout << fixed << res << endl;
    } else {
      int x, val;
      cin >> x >> val;
      w[x] += val;
      while (x > 0) {
        m[x] += val;
        x /= 2;
      }
    }
  }
  return 0;
}
