#include <bits/stdc++.h>
using namespace std;
long long kth;
int n, m;
int at[20];
int pre[20];
int vis[20];
long long dp[20][1 << 17];
long long work(int q) {
  memset(dp, 0, sizeof(dp));
  memset(vis, -1, sizeof(vis));
  for (int i = 0; i < q; i++) {
    vis[at[i]] = i;
  }
  dp[0][0] = 1;
  int tot = 1 << n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < tot; j++) {
      if (!dp[i][j]) continue;
      for (int k = 0; k < n; k++) {
        if (~j >> k & 1) {
          if (~vis[i] && vis[i] != k) {
            continue;
          }
          if ((pre[k] & j) == pre[k]) {
            dp[i + 1][j ^ (1 << k)] += dp[i][j];
          }
        }
      }
    }
  }
  return dp[n][tot - 1];
}
int main() {
  cin >> n >> kth >> m;
  kth -= 2001;
  int x, y;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &x, &y);
    x--, y--;
    pre[y] |= (1 << x);
  }
  if (work(0) <= kth) {
    puts("The times have changed");
    return 0;
  }
  int use = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (use >> j & 1) continue;
      at[i] = j;
      long long tmp = work(i + 1);
      if (tmp <= kth) {
        kth -= tmp;
      } else {
        use |= (1 << j);
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", at[i] + 1);
  }
  return 0;
}
