#include <bits/stdc++.h>
using namespace std;
struct EDGE {
  int v, next;
};
EDGE w[222];
long long f[1 << 17], Y;
int ans[22], ww[22], visit[22], N, M, W = 0;
long long work() {
  memset(f, 0, sizeof(f));
  f[0] = 1;
  for (int i = 0; i < 1 << N; ++i)
    if (f[i]) {
      if (i == 3) int asd = 1;
      int u = 0;
      for (int ii = i; ii; ii >>= 1) u += (ii & 1);
      u++;
      int sta = 1, end = N;
      if (visit[u]) sta = end = visit[u];
      for (int j = sta; j <= end; ++j)
        if (!(i & (1 << j - 1))) {
          bool flag = 1;
          for (int k = ww[j]; k && flag; k = w[k].next)
            if (i & (1 << w[k].v - 1)) flag = 0;
          if (!flag) continue;
          f[i | (1 << j - 1)] += f[i];
        }
    }
  return f[(1 << N) - 1];
}
int main() {
  scanf("%d%I64d%d", &N, &Y, &M);
  Y -= 2000;
  for (int i = 1, u, v; i <= M; ++i) {
    scanf("%d%d", &u, &v);
    w[++W].v = v;
    w[W].next = ww[u];
    ww[u] = W;
  }
  if (work() < Y) {
    puts("The times have changed");
    exit(0);
  }
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j <= N; ++j)
      if (!visit[j]) {
        visit[j] = i;
        long long now = work();
        if (now >= Y) {
          ans[i] = j;
          break;
        }
        Y -= now;
        visit[j] = 0;
      }
  }
  for (int i = 1; i <= N; ++i) printf("%d%c", ans[i], (i == N ? '\n' : ' '));
  return 0;
}
