2024-08-16 02:51:09 +00:00
|
|
|
//60%Points k==1 & 1->k->n
|
2024-08-14 08:45:04 +00:00
|
|
|
|
2024-08-14 03:47:41 +00:00
|
|
|
#include<bits/stdc++.h>
|
2024-08-14 08:45:04 +00:00
|
|
|
#include <cstdlib>
|
2024-08-14 03:47:41 +00:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
struct Node{
|
|
|
|
vector<int> next;
|
|
|
|
int t;
|
|
|
|
};
|
|
|
|
|
|
|
|
const int MAX_N = 2e5+5;
|
|
|
|
int n,m,k;
|
2024-08-14 08:45:04 +00:00
|
|
|
Node nodes[MAX_N];
|
2024-08-14 03:47:41 +00:00
|
|
|
|
|
|
|
int readint();
|
2024-08-14 08:45:04 +00:00
|
|
|
void AC_KE_Q1();
|
2024-08-14 03:47:41 +00:00
|
|
|
|
|
|
|
int main(){
|
|
|
|
n=readint(),m=readint(),k=readint();
|
|
|
|
for(int i=1;i<=n;i++){
|
2024-08-14 08:45:04 +00:00
|
|
|
nodes[i].t=readint();
|
2024-08-14 03:47:41 +00:00
|
|
|
}
|
|
|
|
for(int i=1;i<=m;i++){
|
2024-08-14 08:45:04 +00:00
|
|
|
const int u=readint(),v=readint();
|
|
|
|
nodes[u].next.push_back(v);
|
|
|
|
nodes[v].next.push_back(u);
|
|
|
|
}
|
2024-08-16 02:51:09 +00:00
|
|
|
if(k==1){AC_KE_Q1();exit(0);}
|
|
|
|
int uNum=k-1;
|
|
|
|
cout<<"P";
|
|
|
|
for(int i=2;i<n;i++){
|
|
|
|
if(uNum){
|
|
|
|
uNum--;
|
|
|
|
cout<<"U";
|
|
|
|
}else{
|
|
|
|
cout<<"P";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cout<<"U"<<endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AC_KE_Q1(){
|
2024-08-14 08:45:04 +00:00
|
|
|
bool isUPrint = false;
|
|
|
|
for(int i=1;i<=n;i++){
|
|
|
|
if (!isUPrint) {
|
|
|
|
bool canPrint = true;
|
|
|
|
for(auto i:nodes[i].next){
|
|
|
|
if(i==n){
|
|
|
|
canPrint=false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(canPrint){
|
|
|
|
cout<<"U";
|
|
|
|
isUPrint=true;
|
|
|
|
goto printed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cout<<"P";
|
|
|
|
printed:;
|
2024-08-14 03:47:41 +00:00
|
|
|
}
|
2024-08-14 08:45:04 +00:00
|
|
|
cout<<endl;
|
2024-08-14 03:47:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int readint(){
|
|
|
|
int x=0,w=1;
|
|
|
|
char ch=0;
|
|
|
|
while(!isdigit(ch)){
|
|
|
|
if(ch=='-')w=-1;
|
|
|
|
ch=getchar();
|
|
|
|
}
|
|
|
|
while(isdigit(ch)){
|
|
|
|
x=x*10+(ch-'0');
|
|
|
|
ch=getchar();
|
|
|
|
}
|
|
|
|
return x*w;
|
|
|
|
}
|