#include <bits/stdc++.h>
using namespace std;
int w[17];
int bef[17];
int n, m;
long long kth;
long long dp[17][(1 << 16) + 1];
void init() {
  memset(w, 0, sizeof(w));
  memset(bef, 0, sizeof(bef));
}
long long calc(int pos) {
  int at[17];
  memset(dp, 0, sizeof(dp));
  memset(at, -1, sizeof(at));
  for (int i = 0; i < pos; ++i) at[w[i]] = i;
  dp[0][0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < (1 << n); ++j) {
      if (dp[i][j] == 0) continue;
      long long tmp = dp[i][j];
      for (int k = 0; k < n; ++k) {
        if (j >> k & 1) continue;
        if (at[i] != -1 && at[i] != k) continue;
        if ((j & bef[k]) == bef[k]) dp[i + 1][j ^ (1 << k)] += tmp;
      }
    }
  }
  return dp[n][(1 << n) - 1];
}
int main() {
  init();
  int u, v;
  scanf("%d%I64d%d", &n, &kth, &m);
  while (m--) {
    scanf("%d%d", &u, &v);
    u--;
    v--;
    bef[v] |= 1 << u;
  }
  kth -= 2001;
  if (calc(0) <= kth) {
    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 >> j & 1) continue;
      w[i] = j;
      long long tmp = calc(i + 1);
      if (tmp <= kth)
        kth -= tmp;
      else {
        used |= 1 << j;
        break;
      }
    }
  }
  for (int i = 0; i < n; ++i) printf("%d ", w[i] + 1);
  puts("");
  return 0;
}
