#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000 + 10;
const int INF = 0x7f7f7f7f;
const double eps = 1e-10;
const double pi = acos(-1.0);
inline int compare(double a, double b) {
  return (a > b + eps) ? 1 : ((a + eps < b) ? -1 : 0);
}
map<int, int> sum, node;
double calc(int p, int maxn) {
  if (sum[p] <= maxn) return maxn;
  return 0.5 * calc(p * 2, max(maxn, sum[p * 2 + 1] + node[p])) +
         0.5 * calc(p * 2 + 1, max(maxn, sum[p * 2] + node[p]));
}
int main() {
  string s;
  int h, q, v, e;
  ios::sync_with_stdio(0);
  cin >> h >> q;
  while (q--) {
    cin >> s;
    if (s[0] == 'a') {
      cin >> v >> e;
      node[v] += e;
      for (int i = v; i > 0; i /= 2) sum[i] += e;
    } else
      printf("%.9lf\n", calc(1, 0));
  }
  return 0;
}
