#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30;
int use[MAXN], ans[MAXN], fa[MAXN];
long long dp[1 << 16], y;
long long cal(int n) {
  memset(dp, 0, sizeof(dp));
  dp[0] = 1;
  for (int i = 1; i < (1 << n); ++i) {
    int k(0);
    for (int j = 0; j < n; ++j)
      if (i & (1 << j)) ++k;
    for (int j = 0; j < n; ++j) {
      if ((i & (1 << j)) && (fa[j] & i) == fa[j] &&
          (use[k] == -1 || use[k] == j + 1))
        dp[i] += dp[i ^ (1 << j)];
    }
  }
  return dp[(1 << n) - 1];
}
int main() {
  int n, m, a, b;
  while (scanf("%d%I64d%d", &n, &y, &m) != EOF) {
    y -= 2000;
    memset(fa, 0, sizeof(fa));
    for (int i = 0; i < m; ++i) {
      scanf("%d%d", &a, &b);
      --a;
      --b;
      fa[b] |= 1 << a;
    }
    memset(use, -1, sizeof(use));
    if (cal(n) < y)
      puts("The times have changed");
    else {
      for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= n; ++j) {
          if (use[j] != -1) continue;
          use[j] = i;
          ans[i] = j;
          long long k = cal(n);
          if (y > k) {
            y -= k;
            use[j] = -1;
          } else
            break;
        }
      }
      for (int i = 1; i <= n; ++i) printf("%d%c", ans[i], i == n ? '\n' : ' ');
    }
  }
  return 0;
}
