#include <bits/stdc++.h>
using namespace std;
long long N, Q;
map<long long, double> sum;
double f(long long v, int h, double lower) {
  double s = sum[v];
  if (h == N) return max(lower, s);
  if (s <= lower) return lower;
  long long c1 = 2 * v, c2 = c1 + 1;
  double ret = 0;
  ret += f(c1, h + 1, max(lower, sum[v] - sum[c1])) / 2.0;
  ret += f(c2, h + 1, max(lower, sum[v] - sum[c2])) / 2.0;
  return ret;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> Q;
  while (Q--) {
    string s;
    cin >> s;
    if (s == "add") {
      int v, e;
      cin >> v >> e;
      while (v > 0) {
        sum[v] += e;
        v /= 2;
      }
    } else {
      cout << fixed << setprecision(15) << f(1, 0, 0) << endl;
    }
  }
}
