#include <bits/stdc++.h>
const char NO[] = {"The times have changed"};
bool u[17];
int n, p, num[17], a[17][17], bit[17];
long long f[1 << 16];
bool check(int q, int i, int s) {
  for (int j = 1; j <= p; ++j)
    if (a[j][q] > 0 && i < num[j] || a[j][q] < 0 && i > num[j]) return false;
  for (int j = p + 1; j <= n; ++j)
    if (a[j][q] < 0 && (s & bit[j])) return false;
  return true;
}
long long dp(int k, int s) {
  if (f[s] >= 0) return f[s];
  while (u[k]) --k;
  f[s] = 0;
  for (int i = p + 1; i <= n; ++i)
    if ((s & bit[i]) && check(i, k, s)) f[s] += dp(k - 1, s ^ bit[i]);
  return f[s];
}
int main() {
  long long k;
  int m, x, y, i;
  scanf("%d%I64d%d", &n, &k, &m);
  k -= 2000;
  bit[n] = 1;
  for (i = n - 1; i; --i) bit[i] = bit[i + 1] << 1;
  while (m--) {
    scanf("%d%d", &x, &y);
    if (a[x][y] < 0) {
      printf("%s\n", NO);
      return 0;
    }
    a[x][y] = 1;
    a[y][x] = -1;
  }
  memset(f, -1, sizeof f);
  f[0] = 1;
  long long ff;
  if (dp(n, (1 << n) - 1) < k) {
    printf("%s\n", NO);
    return 0;
  }
  for (p = 1; p <= n; ++p)
    for (i = 1;; ++i)
      if (!u[i] && check(p, i, 0)) {
        u[num[p] = i] = true;
        memset(f, -1, sizeof f);
        f[0] = 1;
        ff = dp(n, (1 << (n - p)) - 1);
        if (ff >= k) break;
        k -= ff;
        u[i] = false;
      }
  for (p = 1; p < n; ++p) printf("%d ", num[p]);
  printf("%d\n", num[n]);
  return 0;
}
