#include <bits/stdc++.h>
using namespace std;
double const pi = 3.1415926535897932384626433832795;
int const inf = (int)1e9;
long long const inf64 = (long long)2e18;
const string name = "c";
const int MMAX = 101;
const int NMAX = 16;
int n, m, x[MMAX], y[MMAX], used[NMAX], ans[NMAX], may[NMAX];
long long k, d[1 << NMAX];
void good_edge(int msk, int x, int y, int msk2, int now) {
  if (msk & (1 << x)) {
    if ((msk2 & (1 << x)) && now < ans[x]) may[y] = 0;
    if (!(msk2 & (1 << x))) may[y] = 0;
  }
  if (msk & (1 << y)) {
    if ((msk2 & (1 << y)) && now > ans[y]) may[x] = 0;
  }
}
long long calc(int num) {
  for (int i = 0; i < (int)m; i++)
    if (ans[x[i]] != -1 && ans[y[i]] != -1 && ans[x[i]] > ans[y[i]]) return 0;
  memset(d, 0, sizeof(d));
  int msk = (1 << num) - 1;
  d[msk] = 1;
  for (int i = 0; i < (int)(1 << n) - 1; i++)
    if ((i & msk) == msk) {
      int cnt = -num;
      for (int j = 0; j < (int)n; j++)
        if (i & (1 << j)) cnt++;
      int now = -1;
      for (int j = (int)n - 1; j >= 0; j--)
        if (!used[j]) {
          if (cnt == 0) {
            now = j;
            break;
          }
          cnt--;
        }
      assert(now != -1);
      memset(may, 1, sizeof(may));
      for (int j = 0; j < (int)m; j++) good_edge(i, x[j], y[j], msk, now);
      for (int j = 0; j < (int)n; j++)
        if (!(i & (1 << j)) && may[j]) d[i | (1 << j)] += d[i];
    }
  return d[(1 << n) - 1];
}
int main() {
  cin >> n >> k >> m;
  for (int i = 0; i < (int)m; i++) {
    cin >> x[i] >> y[i];
    x[i]--, y[i]--;
  }
  k -= 2000;
  memset(ans, 255, sizeof(ans));
  memset(used, 0, sizeof(used));
  if (calc(0) < k) {
    cout << "The times have changed" << endl;
    return 0;
  }
  for (int i = 0; i < (int)n; i++)
    for (int j = 0; j < (int)n; j++)
      if (!used[j]) {
        ans[i] = j;
        used[j] = 1;
        long long tmp = calc(i + 1);
        if (tmp >= k) break;
        k -= tmp;
        used[j] = 0;
        ans[i] = -1;
      }
  for (int i = 0; i < (int)n; i++) cout << ans[i] + 1 << " ";
  return 0;
}
