# discrepancy, balanced 2-coloring, IMO6 1986
from sys import stdin, stdout
input=stdin.readline
def main():
N = int(input())
d={}
hor={}
ver={}
for i in range(N):
x,y = list(map(int, input().split()))
d[(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[(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 | 19ms | 11760 KiB | ||||
2 | Runtime error | 503ms | 136216 KiB | ||||
subtask2 | 0/5 | ||||||
3 | Runtime error | 519ms | 135848 KiB | ||||
4 | Runtime error | 458ms | 135940 KiB | ||||
subtask3 | 0/7 | ||||||
5 | Runtime error | 519ms | 135848 KiB | ||||
6 | Runtime error | 458ms | 135940 KiB | ||||
7 | Runtime error | 545ms | 135388 KiB | ||||
8 | Runtime error | 546ms | 135588 KiB | ||||
9 | Runtime error | 497ms | 135152 KiB | ||||
10 | Accepted | 467ms | 108720 KiB | ||||
subtask4 | 0/20 | ||||||
11 | Runtime error | 688ms | 134908 KiB | ||||
12 | Runtime error | 675ms | 134776 KiB | ||||
13 | Runtime error | 676ms | 134816 KiB | ||||
14 | Runtime error | 563ms | 134828 KiB | ||||
15 | Runtime error | 561ms | 134520 KiB | ||||
16 | Accepted | 456ms | 109604 KiB | ||||
subtask5 | 13/13 | ||||||
17 | Accepted | 18ms | 14108 KiB | ||||
18 | Accepted | 18ms | 14144 KiB | ||||
19 | Accepted | 17ms | 14256 KiB | ||||
20 | Accepted | 18ms | 14424 KiB | ||||
21 | Accepted | 18ms | 14408 KiB | ||||
22 | Accepted | 17ms | 14180 KiB | ||||
23 | Accepted | 17ms | 14552 KiB | ||||
24 | Accepted | 18ms | 14724 KiB | ||||
25 | Accepted | 17ms | 14436 KiB | ||||
26 | Accepted | 17ms | 14472 KiB | ||||
27 | Accepted | 17ms | 14584 KiB | ||||
28 | Accepted | 17ms | 14548 KiB | ||||
29 | Accepted | 18ms | 14540 KiB | ||||
30 | Accepted | 18ms | 14652 KiB | ||||
31 | Accepted | 18ms | 14756 KiB | ||||
32 | Accepted | 17ms | 14688 KiB | ||||
33 | Accepted | 18ms | 14444 KiB | ||||
subtask6 | 20/20 | ||||||
34 | Accepted | 18ms | 14108 KiB | ||||
35 | Accepted | 18ms | 14144 KiB | ||||
36 | Accepted | 17ms | 14256 KiB | ||||
37 | Accepted | 18ms | 14424 KiB | ||||
38 | Accepted | 18ms | 14408 KiB | ||||
39 | Accepted | 17ms | 14180 KiB | ||||
40 | Accepted | 17ms | 14552 KiB | ||||
41 | Accepted | 18ms | 14724 KiB | ||||
42 | Accepted | 17ms | 14436 KiB | ||||
43 | Accepted | 17ms | 14472 KiB | ||||
44 | Accepted | 17ms | 14584 KiB | ||||
45 | Accepted | 17ms | 14548 KiB | ||||
46 | Accepted | 18ms | 14540 KiB | ||||
47 | Accepted | 18ms | 14652 KiB | ||||
48 | Accepted | 18ms | 14756 KiB | ||||
49 | Accepted | 17ms | 14688 KiB | ||||
50 | Accepted | 18ms | 14444 KiB | ||||
51 | Accepted | 26ms | 16312 KiB | ||||
52 | Accepted | 25ms | 16160 KiB | ||||
53 | Accepted | 25ms | 16060 KiB | ||||
54 | Accepted | 25ms | 16240 KiB | ||||
55 | Accepted | 24ms | 16068 KiB | ||||
56 | Accepted | 24ms | 15940 KiB | ||||
57 | Accepted | 24ms | 15968 KiB | ||||
58 | Accepted | 24ms | 16096 KiB | ||||
59 | Accepted | 24ms | 15996 KiB | ||||
60 | Accepted | 24ms | 16012 KiB | ||||
61 | Accepted | 25ms | 15944 KiB | ||||
62 | Accepted | 24ms | 16060 KiB | ||||
63 | Accepted | 24ms | 16156 KiB | ||||
64 | Accepted | 24ms | 16124 KiB | ||||
65 | Accepted | 24ms | 16128 KiB | ||||
subtask7 | 0/35 | ||||||
66 | Accepted | 18ms | 14108 KiB | ||||
67 | Runtime error | 558ms | 133520 KiB | ||||
68 | Runtime error | 519ms | 135848 KiB | ||||
69 | Runtime error | 458ms | 135940 KiB | ||||
70 | Runtime error | 545ms | 135388 KiB | ||||
71 | Runtime error | 546ms | 135588 KiB | ||||
72 | Runtime error | 497ms | 135152 KiB | ||||
73 | Accepted | 467ms | 108720 KiB | ||||
74 | Runtime error | 688ms | 134908 KiB | ||||
75 | Runtime error | 675ms | 134776 KiB | ||||
76 | Runtime error | 676ms | 134816 KiB | ||||
77 | Runtime error | 563ms | 134828 KiB | ||||
78 | Runtime error | 561ms | 134520 KiB | ||||
79 | Accepted | 456ms | 109604 KiB | ||||
80 | Accepted | 18ms | 14144 KiB | ||||
81 | Accepted | 17ms | 14256 KiB | ||||
82 | Accepted | 18ms | 14424 KiB | ||||
83 | Accepted | 18ms | 14408 KiB | ||||
84 | Accepted | 17ms | 14180 KiB | ||||
85 | Accepted | 17ms | 14552 KiB | ||||
86 | Accepted | 18ms | 14724 KiB | ||||
87 | Accepted | 17ms | 14436 KiB | ||||
88 | Accepted | 17ms | 14472 KiB | ||||
89 | Accepted | 17ms | 14584 KiB | ||||
90 | Accepted | 17ms | 14548 KiB | ||||
91 | Accepted | 18ms | 14540 KiB | ||||
92 | Accepted | 18ms | 14652 KiB | ||||
93 | Accepted | 18ms | 14756 KiB | ||||
94 | Accepted | 17ms | 14688 KiB | ||||
95 | Accepted | 18ms | 14444 KiB | ||||
96 | Accepted | 26ms | 16312 KiB | ||||
97 | Accepted | 25ms | 16160 KiB | ||||
98 | Accepted | 25ms | 16060 KiB | ||||
99 | Accepted | 25ms | 16240 KiB | ||||
100 | Accepted | 24ms | 16068 KiB | ||||
101 | Accepted | 24ms | 15940 KiB | ||||
102 | Accepted | 24ms | 15968 KiB | ||||
103 | Accepted | 24ms | 16096 KiB | ||||
104 | Accepted | 24ms | 15996 KiB | ||||
105 | Accepted | 24ms | 16012 KiB | ||||
106 | Accepted | 25ms | 15944 KiB | ||||
107 | Accepted | 24ms | 16060 KiB | ||||
108 | Accepted | 24ms | 16156 KiB | ||||
109 | Accepted | 24ms | 16124 KiB | ||||
110 | Accepted | 24ms | 16128 KiB | ||||
111 | Runtime error | 518ms | 133420 KiB | ||||
112 | Runtime error | 451ms | 133276 KiB | ||||
113 | Runtime error | 449ms | 133108 KiB | ||||
114 | Runtime error | 455ms | 133136 KiB | ||||
115 | Runtime error | 446ms | 133100 KiB | ||||
116 | Runtime error | 451ms | 132740 KiB | ||||
117 | Runtime error | 453ms | 132732 KiB | ||||
118 | Runtime error | 449ms | 132828 KiB | ||||
119 | Runtime error | 449ms | 132880 KiB | ||||
120 | Runtime error | 458ms | 132896 KiB | ||||
121 | Runtime error | 462ms | 132840 KiB |