#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
long long qpow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long dp[1 << 16];
int check[16];
int ans[16];
bool vis[16];
int main() {
  int n, m;
  long long k;
  cin >> n >> k >> m;
  for (int i = 1, a, b; i <= m; ++i) {
    scanf("%d%d", &a, &b);
    --a, --b;
    check[b] |= 1 << a;
  }
  int mx = 1 << n;
  k -= 2000;
  memset(ans, -1, sizeof(ans));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (vis[j]) continue;
      ans[i] = j;
      memset(dp, 0, sizeof(dp));
      dp[0] = 1;
      for (int k = 0; k < mx; ++k) {
        if (dp[k]) {
          int cnt = __builtin_popcount(k);
          for (int p = 0; p < n; ++p) {
            if ((ans[p] == cnt || ans[p] == -1) && !(k >> p & 1) &&
                ((check[p] & k) == check[p])) {
              dp[k | (1 << p)] += dp[k];
            }
          }
        }
      }
      if (dp[mx - 1] >= k) {
        vis[j] = 1;
        break;
      } else {
        if (j == n - 1) {
          printf("The times have changed\n");
          return 0;
        }
        k -= dp[mx - 1];
      }
    }
  }
  for (int i = 0; i < n; ++i) printf("%d ", ans[i] + 1);
  return 0;
}
