#include <bits/stdc++.h>
using namespace std;
const int N = 16;
int n, m, at[N + 1], more[N + 1], w[N + 1];
long long dp[17][1 << N];
long long y;
long long cal(int know) {
  memset(at, -1, sizeof(at));
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 0; i < know; i++) at[w[i]] = i;
  for (int i = 0; i < n; i++) {
    for (int mask = 0; mask < 1 << n; mask++) {
      if (dp[i][mask] == 0) continue;
      for (int j = 0; j < n; j++) {
        if (mask & (1 << j)) continue;
        if (at[i] != -1 && at[i] != j) continue;
        if ((more[j] & mask) == more[j])
          dp[i + 1][mask | (1 << j)] += dp[i][mask];
      }
    }
  }
  return dp[n][(1 << n) - 1];
}
int main() {
  scanf("%d%I64d%d", &n, &y, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    more[b] |= 1 << a;
  }
  long long K = y - 2001;
  if (cal(0) <= K) {
    puts("The times have changed");
    return 0;
  }
  int used = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (used & (1 << j)) continue;
      w[i] = j;
      long long tmp = cal(i + 1);
      if (tmp <= K)
        K -= tmp;
      else {
        used |= 1 << j;
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) printf("%d%c", w[i] + 1, i == n - 1 ? '\n' : ' ');
  return 0;
}
