#include <bits/stdc++.h>
using namespace std;
int con[17][17], chk[17];
long long y;
long long cnt[(1 << (17))];
int pos[17];
int V[17 + 1][15000];
int vn[17 + 1];
int n, m;
int main() {
  scanf("%d%lld%d", &n, &y, &m);
  int u, v;
  while (m--) {
    scanf("%d%d", &u, &v);
    con[u][v] = 1;
  }
  int i, j, k;
  for (k = 1; k <= n; k++) {
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        con[i][j] = con[i][j] | (con[i][k] & con[k][j]);
      }
    }
  }
  for (i = (1 << (n)) - 1; i; i--) {
    int tmp = __builtin_popcount(i);
    V[tmp][vn[tmp]++] = i;
  }
  for (i = 1; i <= n; i++) {
    if (con[i][i] == 1) {
      puts("The times have changed");
      return 0;
    }
  }
  y -= 2000;
  vector<int> res;
  long long p = (1 << (n)) - 1;
  for (int it = 1; it <= n; it++) {
    int tt = clock();
    p ^= (1 << (it - 1));
    for (i = 1; i <= n; i++)
      if (!chk[i]) {
        chk[i] = 1;
        pos[it] = i;
        long long val;
        int cn = 0;
        cnt[0] = 1;
        for (j = n; j >= 1; j--) {
          if (chk[j]) continue;
          cn++;
          int kk;
          for (kk = vn[cn] - 1; kk >= 0; kk--) {
            k = V[cn][kk];
            int v[17], vn(0);
            bool bf = 0;
            for (int _ = 0; _ < n; _++)
              if ((k & (1 << (_)))) {
                v[vn++] = (_ + 1);
                if (_ + 1 <= it) {
                  bf = 1;
                  break;
                }
              }
            if (bf) continue;
            cnt[k] = 0;
            for (int _ = vn - 1; _ >= 0; _--) {
              int l = v[_];
              int ll;
              for (ll = 1; ll <= n; ll++) {
                if (l == ll) continue;
                if ((k & (1 << (ll - 1)))) {
                  if (con[ll][l]) break;
                } else {
                  if (!pos[ll] && con[l][ll]) break;
                  if (pos[ll]) {
                    if (j > pos[ll] && con[l][ll]) break;
                    if (j < pos[ll] && con[ll][l]) break;
                  }
                }
              }
              if (ll <= n) continue;
              cnt[k] += cnt[k ^ (1 << (l - 1))];
            }
          }
        }
        val = cnt[p];
        if (val >= y) break;
        y -= val;
        chk[i] = 0;
      }
    res.push_back(i);
    if (i > n) {
      puts("The times have changed");
      return 0;
    }
  }
  for (i = 0; i < n; i++) {
    if (i) putchar(' ');
    printf("%d", res[i]);
  }
  puts("");
  return 0;
}
