String integerToString(int n, int len) {
    StringBuffer sb = new StringBuffer();
    while (sb.length() < len) {
      sb.append(n % 2 == 0 ? 'a' : 'b');
      n /= 2;
    }
    return sb.reverse().toString();
  }