#include <bits/stdc++.h>
using namespace std;
int limit[17], pos[17];
long long int dp[1 << 17];
int n, k;
long long int m;
long long int DP(int now, int mask) {
  if (now == n) return 1;
  if (dp[mask] != -1) return dp[mask];
  dp[mask] = 0;
  for (int i(0); i < n; ++i) {
    if (mask & (1 << i)) continue;
    if (pos[i] != -1 && pos[i] != now) continue;
    if ((limit[i] & mask) != limit[i]) continue;
    dp[mask] += DP(now + 1, mask | (1 << i));
  }
  return dp[mask];
}
int main() {
  scanf("%d%I64d%d", &n, &m, &k);
  memset(dp, -1, sizeof(dp));
  memset(pos, -1, sizeof(pos));
  memset(limit, 0, sizeof(limit));
  for (int i(0); i < k; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    limit[b - 1] |= (1 << (a - 1));
  }
  m -= 2001;
  long long int tt = DP(0, 0);
  if (tt <= m) {
    cout << "The times have changed" << endl;
    return 0;
  }
  for (int i(0); i < n; ++i) {
    for (int j(0); j < n; ++j) {
      pos[i] = j;
      memset(dp, -1, sizeof(dp));
      tt = DP(0, 0);
      if (m < tt) break;
      m -= tt;
    }
  }
  for (int i(0); i < n; ++i) {
    cout << pos[i] + 1 << " ";
  }
  cout << endl;
  return 0;
}
