#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
template <typename T>
int size(T& a) {
  return (int)a.size();
}
template <typename T>
T sqr(T a) {
  return a * a;
}
const int MAXN = (int)1e5 * 31;
int e[MAXN];
int sum[MAXN];
int Left[MAXN];
int Right[MAXN];
vector<int> getpath(int n) {
  vector<int> res;
  while (true) {
    res.push_back(n);
    if (n == 1) break;
    n /= 2;
  }
  reverse(res.begin(), res.end());
  return res;
}
int getsum(int node) { return node == -1 ? 0 : sum[node]; }
int sz = 0;
int add(int pos, int root, vector<int> path, int ed, int v) {
  int tmp;
  if (root == -1) {
    tmp = sz++;
    e[tmp] = 0;
    Left[tmp] = Right[tmp] = -1;
    sum[tmp] = 0;
  } else {
    tmp = root;
  }
  if (pos == size(path) - 1) {
    e[tmp] += ed;
  } else {
    if (path[pos + 1] == 2 * v) {
      Left[tmp] = add(pos + 1, Left[tmp], path, ed, 2 * v);
    } else {
      Right[tmp] = add(pos + 1, Right[tmp], path, ed, 2 * v + 1);
    }
  }
  sum[tmp] = getsum(Left[tmp]) + getsum(Right[tmp]) + e[tmp];
  return tmp;
}
double calc(int root, int maxComp, double prob) {
  if (root == -1) return 0;
  int L = getsum(Left[root]) + e[root];
  int R = getsum(Right[root]) + e[root];
  if (L == R)
    return max(maxComp, L) * prob;
  else if (L < R) {
    return prob * 0.5 * max(R, maxComp) +
           calc(Right[root], max(maxComp, L), prob * 0.5);
  } else {
    return prob * 0.5 * max(L, maxComp) +
           calc(Left[root], max(maxComp, R), prob * 0.5);
  }
}
int main() {
  int root = -1;
  int h, q;
  string op;
  cin >> h >> q;
  for (int i = (0); i < (q); ++i) {
    cin >> op;
    if (op == "decay") {
      cout << calc(root, 0, 1) << endl;
    } else {
      int v, e;
      cin >> v >> e;
      root = add(0, root, getpath(v), e, 1);
    }
  }
  return 0;
}
