-
Notifications
You must be signed in to change notification settings - Fork 0
/
cf_1380_B.py
42 lines (36 loc) · 890 Bytes
/
cf_1380_B.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
t = int(input())
for i in range(t):
s = input()
fre = {}
for j in range(len(s)):
if s[j] in fre:
fre[s[j]]+=1
else:
fre[s[j]]=1
max_latter = max(fre, key=fre.get)
max_value = max(fre.values())
# for k in range(len(s)):
# if max_latter=='R' and s[k]=='R':
# s2 += 'P'
# elif max_latter=='P':
# s2 += 'S'
# elif max_latter=='S':
# s2 += 'R'
# else:
# s2+=s[k]
# # for k in range(len(s)-max_value):
# # s2+='R'
#
# # print(max_latter,max_value)
#
# # new_string = ''.join()
# print(s2)
if max_latter=='R':
s2 = 'P'*len(s)
elif max_latter=='P':
s2 = 'S'*len(s)
elif max_latter=='S':
s2 = 'R'*len(s)
# print(max_latter,max_value)
# new_string = ''.join()
print(s2)