#include <bits/stdc++.h>
using namespace std;
int const N = 16;
int ans[N];
int pos[N];
int vis[N + 10];
long long dp[N + 2][1 << N];
int g[N];
long long countp(int p, int n) {
  int i, j, k;
  memset(dp, 0, sizeof(dp));
  memset(pos, -1, sizeof(pos));
  for (i = 0; i <= p; i++) {
    pos[ans[i]] = i;
  }
  dp[0][0] = 1;
  int Z = 1 << n;
  Z--;
  for (i = 0; i < n; i++) {
    for (j = 0; j <= Z; j++) {
      if (!dp[i][j]) continue;
      for (k = 0; k < n; k++) {
        if (j & (1 << k)) continue;
        if (pos[i] == -1 || pos[i] == k) {
          if ((j & g[k]) == g[k]) {
            dp[i + 1][j | (1 << k)] += dp[i][j];
          }
        }
      }
    }
  }
  return dp[n][Z];
}
int main() {
  int y0 = 2001;
  int n, m;
  long long y, ym = 1e18;
  int i, j, k, s;
  int ioflag;
  while (scanf("%d%lld%d", &n, &y, &m) != EOF) {
    assert(1 <= n && n <= N);
    assert(y0 <= y && y <= ym);
    assert(0 <= m && m <= 100);
    memset(g, 0, sizeof(g));
    memset(vis, 0, sizeof(vis));
    while (m--) {
      int a, b;
      ioflag = scanf("%d%d", &a, &b);
      assert(1 <= a && a <= n);
      assert(1 <= b && b <= n);
      assert(a != b);
      a--, b--;
      g[b] |= (1 << a);
    }
    y -= y0;
    y++;
    for (i = 0; i < n; i++) {
      for (ans[i] = 0; ans[i] < n; ans[i]++) {
        if (vis[ans[i]]) continue;
        long long s = countp(i, n);
        if (y > s) {
          y -= s;
          continue;
        } else {
          vis[ans[i]] = 1;
          break;
        }
      }
      if (ans[i] >= n) {
        ans[0] = -1;
        break;
      }
    }
    if (ans[0] < 0) {
      puts("The times have changed");
      continue;
    }
    for (i = 0; i < n; i++) {
      if (i) putchar(' ');
      printf("%d", ans[i] + 1);
    }
    puts("");
  }
  return 0;
}
