#include <bits/stdc++.h>
using namespace std;
long long taken[1 << 20];
int bitcnt(int n) {
  int ans = 0;
  while (n) {
    n &= n - 1;
    ++ans;
  }
  return ans;
}
int main() {
  int n;
  long long y;
  int m;
  cin >> n >> y >> m;
  y -= 2001;
  int pred[20] = {0};
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    pred[b] |= 1 << a;
  }
  int seat[20], member[20];
  fill(seat, seat + 20, -1);
  fill(member, member + 20, -1);
  for (int p = 0; p < n; ++p) {
    for (int prof = 0; prof < n; ++prof)
      if (member[prof] < 0) {
        seat[p] = prof;
        member[prof] = p;
        memset(taken, 0, sizeof taken);
        taken[(1 << n) - 1] = 1;
        for (int b = (1 << n) - 1; b >= 0; b--) {
          int k = bitcnt(b);
          k--;
          int i;
          if (member[k] >= 0) {
            i = member[k];
            if ((b & 1 << i) && (b & pred[i]) == pred[i])
              taken[b ^ (1 << i)] += taken[b];
          } else {
            for (i = 0; i < n; ++i)
              if ((b & 1 << i) && (b & pred[i]) == pred[i]) {
                taken[b ^ (1 << i)] += taken[b];
              }
          }
        }
        long long cnt = taken[0];
        if (cnt > y) {
          break;
        } else {
          y -= cnt;
          seat[p] = -1;
          member[prof] = -1;
        }
      }
    if (seat[p] < 0) {
      y = 1;
      break;
    }
  }
  if (y > 0) {
    cout << "The times have changed" << endl;
  } else {
    for (int i = 0; i < n; ++i) {
      if (i) {
        cout << ' ';
      }
      cout << (seat[i] + 1);
    }
    cout << endl;
  }
}
