1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include<bits/stdc++.h>
using namespace std;
mt19937 rng(212303);
const int N=1000;
bool check(vector<int> p){
  for(int i=0;i<N;i++)
    if(p[p[i]]==i)return false;
  return true;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);
  vector<int> p(N);
  iota(p.begin(),p.end(),0);
  while(!check(p))shuffle(p.begin(),p.end(),rng);
  string s; cin>>s;
  int a,b; cin>>a>>b;
  if(s[0]=='A')cout<<p[a-1]+1<<' '<<p[b-1]+1<<endl;
  else{
    for(int i=0;i<N;i++)
      if(p[i]==a-1)cout<<i+1<<' ';
    for(int i=0;i<N;i++)
      if(p[i]==b-1)cout<<i+1<<endl;
  }
  return 0;
}