# discrepancy, balanced 2-coloring, IMO6 1986
from sys import stdin, stdout
input=stdin.readline
def main():
N = int(input())
points=[]
d={}
hor={}
ver={}
for i in range(N):
x,y = list(map(int, input().split()))
d[(x,y)] = len(points)
points.append((x,y))
try: hor[y].append(x)
except: hor[y]=[x]
try: ver[x].append(y)
except: ver[x]=[y]
res=['L']*len(points)
graph={}
for y in hor:
for i in range(len(hor[y])//2):
try: graph[(hor[y][2*i],y)].append((hor[y][2*i+1],y))
except: graph[(hor[y][2*i],y)] = [(hor[y][2*i+1],y)]
try: graph[(hor[y][2*i+1],y)].append((hor[y][2*i],y))
except: graph[(hor[y][2*i+1],y)] = [(hor[y][2*i],y)]
for x in ver:
for i in range(len(ver[x])//2):
try: graph[(x,ver[x][2*i])].append((x,ver[x][2*i+1]))
except: graph[(x,ver[x][2*i])] = [(x,ver[x][2*i+1])]
try: graph[(x,ver[x][2*i+1])].append((x,ver[x][2*i]))
except: graph[(x,ver[x][2*i+1])] = [(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 | 18ms | 11872 KiB | ||||
2 | Runtime error | 465ms | 135896 KiB | ||||
subtask2 | 0/5 | ||||||
3 | Runtime error | 509ms | 135884 KiB | ||||
4 | Runtime error | 597ms | 135728 KiB | ||||
subtask3 | 0/7 | ||||||
5 | Runtime error | 509ms | 135884 KiB | ||||
6 | Runtime error | 597ms | 135728 KiB | ||||
7 | Runtime error | 610ms | 135576 KiB | ||||
8 | Runtime error | 521ms | 135124 KiB | ||||
9 | Runtime error | 541ms | 135284 KiB | ||||
10 | Accepted | 646ms | 122740 KiB | ||||
subtask4 | 0/20 | ||||||
11 | Runtime error | 554ms | 135072 KiB | ||||
12 | Runtime error | 657ms | 134932 KiB | ||||
13 | Runtime error | 538ms | 134632 KiB | ||||
14 | Runtime error | 540ms | 134572 KiB | ||||
15 | Runtime error | 540ms | 134676 KiB | ||||
16 | Accepted | 546ms | 123416 KiB | ||||
subtask5 | 13/13 | ||||||
17 | Accepted | 17ms | 13784 KiB | ||||
18 | Accepted | 17ms | 14040 KiB | ||||
19 | Accepted | 17ms | 14192 KiB | ||||
20 | Accepted | 17ms | 14152 KiB | ||||
21 | Accepted | 17ms | 14332 KiB | ||||
22 | Accepted | 17ms | 14124 KiB | ||||
23 | Accepted | 17ms | 14404 KiB | ||||
24 | Accepted | 17ms | 14660 KiB | ||||
25 | Accepted | 17ms | 14368 KiB | ||||
26 | Accepted | 17ms | 14232 KiB | ||||
27 | Accepted | 17ms | 14520 KiB | ||||
28 | Accepted | 17ms | 14476 KiB | ||||
29 | Accepted | 17ms | 14312 KiB | ||||
30 | Accepted | 17ms | 14340 KiB | ||||
31 | Accepted | 17ms | 14356 KiB | ||||
32 | Accepted | 17ms | 14352 KiB | ||||
33 | Accepted | 17ms | 14644 KiB | ||||
subtask6 | 20/20 | ||||||
34 | Accepted | 17ms | 13784 KiB | ||||
35 | Accepted | 17ms | 14040 KiB | ||||
36 | Accepted | 17ms | 14192 KiB | ||||
37 | Accepted | 17ms | 14152 KiB | ||||
38 | Accepted | 17ms | 14332 KiB | ||||
39 | Accepted | 17ms | 14124 KiB | ||||
40 | Accepted | 17ms | 14404 KiB | ||||
41 | Accepted | 17ms | 14660 KiB | ||||
42 | Accepted | 17ms | 14368 KiB | ||||
43 | Accepted | 17ms | 14232 KiB | ||||
44 | Accepted | 17ms | 14520 KiB | ||||
45 | Accepted | 17ms | 14476 KiB | ||||
46 | Accepted | 17ms | 14312 KiB | ||||
47 | Accepted | 17ms | 14340 KiB | ||||
48 | Accepted | 17ms | 14356 KiB | ||||
49 | Accepted | 17ms | 14352 KiB | ||||
50 | Accepted | 17ms | 14644 KiB | ||||
51 | Accepted | 25ms | 16184 KiB | ||||
52 | Accepted | 24ms | 15964 KiB | ||||
53 | Accepted | 24ms | 15976 KiB | ||||
54 | Accepted | 24ms | 16084 KiB | ||||
55 | Accepted | 24ms | 15916 KiB | ||||
56 | Accepted | 25ms | 15688 KiB | ||||
57 | Accepted | 24ms | 15964 KiB | ||||
58 | Accepted | 24ms | 15892 KiB | ||||
59 | Accepted | 24ms | 15808 KiB | ||||
60 | Accepted | 23ms | 15692 KiB | ||||
61 | Accepted | 24ms | 15852 KiB | ||||
62 | Accepted | 24ms | 15912 KiB | ||||
63 | Accepted | 24ms | 15668 KiB | ||||
64 | Accepted | 24ms | 15904 KiB | ||||
65 | Accepted | 24ms | 15868 KiB | ||||
subtask7 | 0/35 | ||||||
66 | Accepted | 17ms | 13784 KiB | ||||
67 | Runtime error | 444ms | 133604 KiB | ||||
68 | Runtime error | 509ms | 135884 KiB | ||||
69 | Runtime error | 597ms | 135728 KiB | ||||
70 | Runtime error | 610ms | 135576 KiB | ||||
71 | Runtime error | 521ms | 135124 KiB | ||||
72 | Runtime error | 541ms | 135284 KiB | ||||
73 | Accepted | 646ms | 122740 KiB | ||||
74 | Runtime error | 554ms | 135072 KiB | ||||
75 | Runtime error | 657ms | 134932 KiB | ||||
76 | Runtime error | 538ms | 134632 KiB | ||||
77 | Runtime error | 540ms | 134572 KiB | ||||
78 | Runtime error | 540ms | 134676 KiB | ||||
79 | Accepted | 546ms | 123416 KiB | ||||
80 | Accepted | 17ms | 14040 KiB | ||||
81 | Accepted | 17ms | 14192 KiB | ||||
82 | Accepted | 17ms | 14152 KiB | ||||
83 | Accepted | 17ms | 14332 KiB | ||||
84 | Accepted | 17ms | 14124 KiB | ||||
85 | Accepted | 17ms | 14404 KiB | ||||
86 | Accepted | 17ms | 14660 KiB | ||||
87 | Accepted | 17ms | 14368 KiB | ||||
88 | Accepted | 17ms | 14232 KiB | ||||
89 | Accepted | 17ms | 14520 KiB | ||||
90 | Accepted | 17ms | 14476 KiB | ||||
91 | Accepted | 17ms | 14312 KiB | ||||
92 | Accepted | 17ms | 14340 KiB | ||||
93 | Accepted | 17ms | 14356 KiB | ||||
94 | Accepted | 17ms | 14352 KiB | ||||
95 | Accepted | 17ms | 14644 KiB | ||||
96 | Accepted | 25ms | 16184 KiB | ||||
97 | Accepted | 24ms | 15964 KiB | ||||
98 | Accepted | 24ms | 15976 KiB | ||||
99 | Accepted | 24ms | 16084 KiB | ||||
100 | Accepted | 24ms | 15916 KiB | ||||
101 | Accepted | 25ms | 15688 KiB | ||||
102 | Accepted | 24ms | 15964 KiB | ||||
103 | Accepted | 24ms | 15892 KiB | ||||
104 | Accepted | 24ms | 15808 KiB | ||||
105 | Accepted | 23ms | 15692 KiB | ||||
106 | Accepted | 24ms | 15852 KiB | ||||
107 | Accepted | 24ms | 15912 KiB | ||||
108 | Accepted | 24ms | 15668 KiB | ||||
109 | Accepted | 24ms | 15904 KiB | ||||
110 | Accepted | 24ms | 15868 KiB | ||||
111 | Runtime error | 412ms | 133736 KiB | ||||
112 | Runtime error | 407ms | 133496 KiB | ||||
113 | Runtime error | 409ms | 133636 KiB | ||||
114 | Runtime error | 412ms | 133700 KiB | ||||
115 | Runtime error | 409ms | 133352 KiB | ||||
116 | Runtime error | 416ms | 133660 KiB | ||||
117 | Runtime error | 421ms | 133740 KiB | ||||
118 | Runtime error | 412ms | 133644 KiB | ||||
119 | Runtime error | 418ms | 133616 KiB | ||||
120 | Runtime error | 481ms | 133492 KiB | ||||
121 | Runtime error | 412ms | 133600 KiB |