#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double EPS = 1E-8;
const long double PI = 3.1415926535897932384626433832795;
const int MAXN = 17;
int n, m, mm[MAXN], p[MAXN], u[1 << MAXN], cu, ans[MAXN];
long long d[1 << MAXN];
long long get(int mask) {
  if (mask == (1 << n) - 1) return 1;
  long long &ans = d[mask];
  int &used = u[mask];
  if (used == cu) return ans;
  ans = 0;
  used = cu;
  int cnt = 0;
  for (int i = 0; i < (int)(n); i++)
    if ((mask & (1 << i)) != 0) cnt++;
  for (int i = 0; i < (int)(n); i++)
    if (p[cnt] == -1 || p[cnt] == i)
      if ((mask & (1 << i)) == 0)
        if ((mm[i] & mask) == mm[i]) ans += get(mask | (1 << i));
  return ans;
}
int main() {
  long long k;
  cin >> n >> k >> m;
  for (int i = 0; i < (int)(m); i++) {
    int v, u;
    cin >> v >> u;
    mm[u - 1] |= (1 << (v - 1));
  }
  k -= 2001;
  cu++;
  memset(p, 255, sizeof p);
  if (get(0) <= k) {
    cout << "The times have changed" << endl;
    return 0;
  }
  for (int pos = 0; pos < (int)(n); pos++)
    for (int value = 0; value < (int)(n); value++)
      if (p[value] == -1) {
        p[value] = pos;
        ans[pos] = value;
        cu++;
        long long cur = get(0);
        if (cur > k) break;
        k -= cur;
        ans[pos] = p[value] = -1;
      }
  for (int i = 0; i < (int)(n); i++) ans[p[i]] = i;
  for (int i = 0; i < (int)(n); i++) cout << ans[i] + 1 << " ";
  return 0;
}
