# discrepancy, balanced 2-coloring, IMO6 1986
from sys import stdin, stdout
input=stdin.readline
def f(x,y):
return 10**9*x+y
#def g(c):
# return c//10**9,c%10**9
def main():
N = int(input())
d={}
hor={}
ver={}
for i in range(N):
x,y = list(map(int, input().split()))
d[f(x,y)] = i
try: hor[y].append(x)
except: hor[y]=[x]
try: ver[x].append(y)
except: ver[x]=[y]
res=['L']*N
graph={}
for y in hor:
for i in range(len(hor[y])//2):
try: graph[f(hor[y][2*i],y)].append(f(hor[y][2*i+1],y))
except: graph[f(hor[y][2*i],y)] = [f(hor[y][2*i+1],y)]
try: graph[f(hor[y][2*i+1],y)].append(f(hor[y][2*i],y))
except: graph[f(hor[y][2*i+1],y)] = [f(hor[y][2*i],y)]
for x in ver:
for i in range(len(ver[x])//2):
try: graph[f(x,ver[x][2*i])].append(f(x,ver[x][2*i+1]))
except: graph[f(x,ver[x][2*i])] = [f(x,ver[x][2*i+1])]
try: graph[f(x,ver[x][2*i+1])].append(f(x,ver[x][2*i]))
except: graph[f(x,ver[x][2*i+1])] = [f(x,ver[x][2*i])]
while graph:
v,cur=graph.popitem()
l=1
res[d[v]]='F'
while cur:
if l%2==0:
for v in cur:
res[d[v]]='F'
tmp=[]
for v in cur:
if v in graph:
sz=graph.pop(v)
for w in sz:
if w in graph:
tmp.append(w)
cur=tmp
l+=1
print(''.join(res))
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 48ms | 77304 KiB | ||||
2 | Runtime error | 230ms | 171616 KiB | ||||
subtask2 | 0/5 | ||||||
3 | Runtime error | 192ms | 171336 KiB | ||||
4 | Runtime error | 187ms | 170696 KiB | ||||
subtask3 | 0/7 | ||||||
5 | Runtime error | 192ms | 171336 KiB | ||||
6 | Runtime error | 187ms | 170696 KiB | ||||
7 | Runtime error | 194ms | 170548 KiB | ||||
8 | Runtime error | 238ms | 170296 KiB | ||||
9 | Runtime error | 224ms | 169996 KiB | ||||
10 | Runtime error | 174ms | 169672 KiB | ||||
subtask4 | 0/20 | ||||||
11 | Runtime error | 261ms | 169724 KiB | ||||
12 | Runtime error | 225ms | 169680 KiB | ||||
13 | Runtime error | 263ms | 169444 KiB | ||||
14 | Runtime error | 261ms | 169428 KiB | ||||
15 | Runtime error | 252ms | 169188 KiB | ||||
16 | Runtime error | 178ms | 169272 KiB | ||||
subtask5 | 13/13 | ||||||
17 | Accepted | 41ms | 79804 KiB | ||||
18 | Accepted | 46ms | 79436 KiB | ||||
19 | Accepted | 43ms | 80408 KiB | ||||
20 | Accepted | 39ms | 80120 KiB | ||||
21 | Accepted | 48ms | 80196 KiB | ||||
22 | Accepted | 48ms | 80764 KiB | ||||
23 | Accepted | 48ms | 80876 KiB | ||||
24 | Accepted | 46ms | 80624 KiB | ||||
25 | Accepted | 43ms | 80960 KiB | ||||
26 | Accepted | 46ms | 80320 KiB | ||||
27 | Accepted | 46ms | 80764 KiB | ||||
28 | Accepted | 43ms | 81044 KiB | ||||
29 | Accepted | 41ms | 81012 KiB | ||||
30 | Accepted | 46ms | 80944 KiB | ||||
31 | Accepted | 43ms | 81632 KiB | ||||
32 | Accepted | 46ms | 81268 KiB | ||||
33 | Accepted | 46ms | 81208 KiB | ||||
subtask6 | 20/20 | ||||||
34 | Accepted | 41ms | 79804 KiB | ||||
35 | Accepted | 46ms | 79436 KiB | ||||
36 | Accepted | 43ms | 80408 KiB | ||||
37 | Accepted | 39ms | 80120 KiB | ||||
38 | Accepted | 48ms | 80196 KiB | ||||
39 | Accepted | 48ms | 80764 KiB | ||||
40 | Accepted | 48ms | 80876 KiB | ||||
41 | Accepted | 46ms | 80624 KiB | ||||
42 | Accepted | 43ms | 80960 KiB | ||||
43 | Accepted | 46ms | 80320 KiB | ||||
44 | Accepted | 46ms | 80764 KiB | ||||
45 | Accepted | 43ms | 81044 KiB | ||||
46 | Accepted | 41ms | 81012 KiB | ||||
47 | Accepted | 46ms | 80944 KiB | ||||
48 | Accepted | 43ms | 81632 KiB | ||||
49 | Accepted | 46ms | 81268 KiB | ||||
50 | Accepted | 46ms | 81208 KiB | ||||
51 | Accepted | 71ms | 91956 KiB | ||||
52 | Accepted | 86ms | 92312 KiB | ||||
53 | Accepted | 75ms | 92420 KiB | ||||
54 | Accepted | 71ms | 92160 KiB | ||||
55 | Accepted | 64ms | 91772 KiB | ||||
56 | Accepted | 72ms | 91740 KiB | ||||
57 | Accepted | 72ms | 91924 KiB | ||||
58 | Accepted | 72ms | 92020 KiB | ||||
59 | Accepted | 74ms | 91632 KiB | ||||
60 | Accepted | 70ms | 91928 KiB | ||||
61 | Accepted | 67ms | 92076 KiB | ||||
62 | Accepted | 68ms | 92456 KiB | ||||
63 | Accepted | 68ms | 93040 KiB | ||||
64 | Accepted | 65ms | 91624 KiB | ||||
65 | Accepted | 76ms | 92676 KiB | ||||
subtask7 | 0/35 | ||||||
66 | Accepted | 41ms | 79804 KiB | ||||
67 | Runtime error | 217ms | 167400 KiB | ||||
68 | Runtime error | 192ms | 171336 KiB | ||||
69 | Runtime error | 187ms | 170696 KiB | ||||
70 | Runtime error | 194ms | 170548 KiB | ||||
71 | Runtime error | 238ms | 170296 KiB | ||||
72 | Runtime error | 224ms | 169996 KiB | ||||
73 | Runtime error | 174ms | 169672 KiB | ||||
74 | Runtime error | 261ms | 169724 KiB | ||||
75 | Runtime error | 225ms | 169680 KiB | ||||
76 | Runtime error | 263ms | 169444 KiB | ||||
77 | Runtime error | 261ms | 169428 KiB | ||||
78 | Runtime error | 252ms | 169188 KiB | ||||
79 | Runtime error | 178ms | 169272 KiB | ||||
80 | Accepted | 46ms | 79436 KiB | ||||
81 | Accepted | 43ms | 80408 KiB | ||||
82 | Accepted | 39ms | 80120 KiB | ||||
83 | Accepted | 48ms | 80196 KiB | ||||
84 | Accepted | 48ms | 80764 KiB | ||||
85 | Accepted | 48ms | 80876 KiB | ||||
86 | Accepted | 46ms | 80624 KiB | ||||
87 | Accepted | 43ms | 80960 KiB | ||||
88 | Accepted | 46ms | 80320 KiB | ||||
89 | Accepted | 46ms | 80764 KiB | ||||
90 | Accepted | 43ms | 81044 KiB | ||||
91 | Accepted | 41ms | 81012 KiB | ||||
92 | Accepted | 46ms | 80944 KiB | ||||
93 | Accepted | 43ms | 81632 KiB | ||||
94 | Accepted | 46ms | 81268 KiB | ||||
95 | Accepted | 46ms | 81208 KiB | ||||
96 | Accepted | 71ms | 91956 KiB | ||||
97 | Accepted | 86ms | 92312 KiB | ||||
98 | Accepted | 75ms | 92420 KiB | ||||
99 | Accepted | 71ms | 92160 KiB | ||||
100 | Accepted | 64ms | 91772 KiB | ||||
101 | Accepted | 72ms | 91740 KiB | ||||
102 | Accepted | 72ms | 91924 KiB | ||||
103 | Accepted | 72ms | 92020 KiB | ||||
104 | Accepted | 74ms | 91632 KiB | ||||
105 | Accepted | 70ms | 91928 KiB | ||||
106 | Accepted | 67ms | 92076 KiB | ||||
107 | Accepted | 68ms | 92456 KiB | ||||
108 | Accepted | 68ms | 93040 KiB | ||||
109 | Accepted | 65ms | 91624 KiB | ||||
110 | Accepted | 76ms | 92676 KiB | ||||
111 | Runtime error | 201ms | 167256 KiB | ||||
112 | Runtime error | 225ms | 167348 KiB | ||||
113 | Runtime error | 216ms | 167364 KiB | ||||
114 | Runtime error | 203ms | 167164 KiB | ||||
115 | Runtime error | 214ms | 167260 KiB | ||||
116 | Runtime error | 211ms | 167280 KiB | ||||
117 | Runtime error | 238ms | 167348 KiB | ||||
118 | Runtime error | 224ms | 167252 KiB | ||||
119 | Runtime error | 233ms | 167268 KiB | ||||
120 | Runtime error | 215ms | 167432 KiB | ||||
121 | Runtime error | 224ms | 167324 KiB |