#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
void pr_init() {}
long long n, k, h, x;
string an;
long long nx_subtr(long long a, long long b) {
  long long cn = 0;
  for (long long i = 1; i <= n; i++)
    if (i != a && i != b) {
      cout << "? " << a << " " << i << " " << b << endl;
      cin >> an;
      if (an == "Yes") cn++;
    }
  if (cn == 2 * h - 1) return 1;
  return 0;
}
long long vis[1505];
long long get_leaf(long long x) {
  for (long long i = 1; i <= n; i++)
    if (!vis[i]) {
      long long y = i, bl = 1;
      while (y == i) y = rand() % n + 1;
      for (long long j = 1; j <= n; j++)
        if (j != i && j != y) {
          cout << "? " << j << " " << i << " " << y << endl;
          fflush(stdin);
          cin >> an;
          if (an == "Yes") {
            bl = 0;
            break;
          }
        }
      if (!bl) continue;
      if (x == -1 || nx_subtr(x, i)) {
        vis[i] = 1;
        return i;
      }
    }
}
void solve() {
  cin >> n >> k;
  h = 0, x = n;
  while (x > 0) {
    x /= k;
    h++;
  }
  h--;
  long long lf1 = get_leaf(-1);
  long long lf2 = get_leaf(lf1);
  memset(vis, 0, sizeof(vis));
  vector<long long> nd(2);
  nd[0] = lf1;
  nd[1] = lf2;
  vis[lf1] = vis[lf2] = 1;
  for (long long i = 1; i <= n; i++)
    if (!vis[i]) {
      for (long long j = 1; j < (long long)nd.size(); j++) {
        cout << "? " << nd[j - 1] << " " << i << " " << nd[j] << endl;
        fflush(stdin);
        cin >> an;
        if (an == "Yes") {
          nd.insert(nd.begin() + j, i);
          break;
        }
      }
    }
  cout << "! " << nd[h] << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  auto start = high_resolution_clock::now();
  solve();
  auto stop = high_resolution_clock::now();
  auto duration = duration_cast<microseconds>(stop - start);
  return 0;
}
