#include <bits/stdc++.h>
using namespace std;
const int maxn = 1111, maxm = 111111, maxs = 1111111, mod = 998244353;
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 0;
  while (ch < '0' || ch > '9') f |= ch == '-', ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return f ? -x : x;
}
inline int qpow(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) ans = 1ll * ans * a % mod;
  return ans;
}
int n, m, T, el, head[maxn], to[maxm], nxt[maxm], deg[maxn], q[maxn],
    h = 1, r = 0, id[maxn], tl, x[4444], y[4444], S[maxn], at[22];
char op[4444], ver[10];
bool vis[maxs];
inline void add(int u, int v) {
  to[++el] = v;
  nxt[el] = head[u];
  head[u] = el;
}
inline void add(char c, int xx, int yy) {
  tl++;
  op[tl] = c;
  x[tl] = xx;
  y[tl] = yy;
}
int main() {
  n = read();
  m = read();
  T = read();
  for (int i = (1); i <= (m); i++) {
    int u = read(), v = read();
    add(u, v);
    deg[v]++;
  }
  for (int i = (1); i <= (n); i++)
    if (!deg[i]) q[++r] = i;
  while (h <= r) {
    int u = q[h++];
    for (int i = head[u]; i; i = nxt[i]) {
      int v = to[i];
      if (!--deg[v]) q[++r] = v;
    }
  }
  for (int i = (1); i <= (n); i++) id[i] = -1;
  for (int i = (r); i >= (max(1, r - 19)); i--)
    id[q[i]] = r - i, at[r - i] = q[i];
  for (int i = (max(1, r - 19)); i <= (r); i++)
    for (int j = (i + 1); j <= (r); j++) add('+', q[i], q[j]);
  if (r - 20 >= 1) {
    for (int i = (1); i <= (r - 20); i++) {
      add('+', q[i], q[i]);
      for (int j = head[q[i]]; j; j = nxt[j])
        if (~id[to[j]]) S[q[i]] |= 1 << id[to[j]];
      bool flag = false;
      for (int x = (20); x >= (0); x--) {
        for (int y = (20); y >= (x + 1); y--) {
          for (int z = (20); z >= (y + 1); z--) {
            int tmp = S[q[i]];
            if (x <= 19) tmp ^= 1 << x;
            if (y <= 19) tmp ^= 1 << y;
            if (z <= 19) tmp ^= 1 << z;
            if (!vis[tmp]) {
              for (int w = (0); w <= (19); w++) {
                int a = (S[q[i]] >> w) & 1, b = (tmp >> w) & 1;
                if (!a && b) add('+', q[i], at[w]);
                if (a && !b) add('-', q[i], at[w]);
              }
              S[q[i]] = tmp;
              vis[tmp] = true;
              flag = true;
              break;
            }
          }
          if (flag) break;
        }
        if (flag) break;
      }
      if (!flag) return puts("/kk"), 1;
    }
  }
  printf("%d\n", tl);
  for (int i = (1); i <= (tl); i++) printf("%c %d %d\n", op[i], x[i], y[i]);
  fflush(stdout);
  while (T--) {
    int s = 0, flag = 0;
    for (int i = (0); i <= (min(r - 1, 19)); i++) {
      printf("? 1 %d\n", at[i]);
      fflush(stdout);
      scanf("%s", ver);
      switch (ver[0]) {
        case 'W':
          s |= 1 << i;
          break;
        case 'L':
          flag = at[i];
          break;
        case 'D':
          break;
      }
    }
    if (flag)
      printf("! %d\n", flag);
    else {
      for (int i = (1); i <= (r - 20); i++)
        if (S[q[i]] == s) {
          printf("! %d\n", q[i]);
          break;
        }
    }
    fflush(stdout);
    scanf("%s", ver);
    if (ver[0] == 'W') return puts("/kk"), 2;
  }
}
