#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MAXN = 101000;
const long long MOD = 1000000007;
long long dp[(1 << 16) + 100];
bool mark[20];
long long ans[20];
long long full;
long long gt[20];
long long n, y, m;
void init() {
  memset(ans, -1, sizeof ans);
  memset(gt, 0, sizeof gt);
  memset(mark, 0, sizeof mark);
  full = (1 << n) - 1;
  y -= 2001;
}
int main(int argc, char const *argv[]) {
  while (scanf("%I64d %I64d %I64d", &n, &y, &m) != EOF) {
    init();
    while (m--) {
      long long a, b;
      cin >> a >> b;
      a--;
      b--;
      gt[b] |= 1 << a;
    }
    bool flag = 1;
    for (long long i = 1; i <= n && flag; ++i) {
      for (ans[i] = 1;; ans[i]++) {
        if (mark[ans[i]]) continue;
        if (ans[i] > n) {
          puts("The times have changed");
          flag = 0;
          break;
        }
        memset(dp, 0, sizeof dp);
        dp[0] = 1;
        for (long long s = 0; s <= full; ++s) {
          if (!dp[s]) continue;
          long long cnt = __builtin_popcount(s);
          for (long long k = 1; k <= n; ++k) {
            if (!(s & (1 << (k - 1))))
              if ((ans[k] == -1 || ans[k] == cnt + 1) &&
                  (gt[k - 1] & s) == gt[k - 1])
                dp[s | (1 << (k - 1))] += dp[s];
          }
        }
        if (y >= dp[full])
          y -= dp[full];
        else {
          mark[ans[i]] = 1;
          break;
        }
      }
    }
    if (flag)
      for (long long i = 1; i <= n; ++i)
        printf("%lld%c", ans[i], i == n ? '\n' : ' ');
  }
}
