#include <bits/stdc++.h>
using namespace std;
const int N = 1505;
int n, k;
map<tuple<int, int, int>, bool> memo;
bool query(int a, int b, int c) {
  if (b == a || b == c) return 1;
  if (a > c) swap(a, c);
  auto s = make_tuple(a, b, c);
  if (memo.count(s)) return memo[s];
  cout << "? " << a + 1 << ' ' << b + 1 << ' ' << c + 1 << endl;
  cout.flush();
  string ans;
  cin >> ans;
  return memo[s] = (ans[0] == 'Y');
}
bool alive[N], done;
int GOAL;
int closer(int u, int v) {
  for (int w = 0; w < int(n); w++)
    if (alive[w] && w != u && w != v && query(u, w, v)) v = w;
  return v;
}
int iter(int u) {
  vector<int> nodes;
  for (int w = 0; w < int(n); w++)
    if (w != u && alive[w]) nodes.push_back(w);
  int sz = nodes.size();
  auto w = nodes[rand() % sz];
  w = closer(u, w);
  vector<int> u_friends, w_friends;
  u_friends.push_back(u);
  w_friends.push_back(w);
  for (auto v : nodes)
    if (v != w) {
      if (query(u, w, v))
        w_friends.push_back(v);
      else
        u_friends.push_back(u);
    }
  int ans;
  if (u_friends.size() > w_friends.size()) {
    ans = u;
    if (u_friends.size() == GOAL) done = 1;
    for (auto v : w_friends) alive[v] = 0;
  } else {
    ans = w;
    if (w_friends.size() == GOAL) done = 1;
    for (auto v : u_friends) alive[v] = 0;
  }
  return ans;
}
int main() {
  srand(time(0));
  cin >> n >> k;
  fill_n(alive, n, 1);
  GOAL = 1;
  while (GOAL * k <= n) GOAL *= k;
  int u = 0;
  while (!done) u = iter(u);
  cout << "! " << u + 1 << endl;
}
