#include <bits/stdc++.h>
using namespace std;
long long a[20], ans[20], v[20], n, s;
long long f[65536];
long long dp() {
  long long i, j, k;
  memset(f, 0, sizeof(f));
  f[0] = 1;
  for (j = 0; j < s; j++)
    if (f[j] > 0) {
      k = 1;
      for (i = 1; i <= n; i++)
        if (j & (1 << (i - 1))) k++;
      for (i = 1; i <= n; i++)
        if ((j & (1 << (i - 1))) == 0 && ((j & a[i]) == a[i]) &&
            (v[k] == 0 || v[k] == i))
          f[j | (1 << (i - 1))] += f[j];
    }
  return f[s];
}
int main() {
  long long year, m, i, j, k, t, x, y;
  cin >> n >> year >> m;
  year = year - 2001 + 1;
  s = (1 << n) - 1;
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    a[y] |= 1 << (x - 1);
  }
  if (dp() < year) {
    printf("The times have changed\n");
    return 0;
  }
  for (k = 1; k <= n; k++) {
    x = 0;
    for (i = 1; i <= n; i++)
      if (v[i] == 0) {
        v[i] = k;
        y = dp();
        if (x + y < year)
          x += y;
        else
          break;
        v[i] = 0;
      }
    ans[k] = i;
    year -= x;
  }
  for (i = 1; i <= n - 1; i++) cout << ans[i] << ' ';
  cout << ans[n] << endl;
}
