Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split them into two sets each containing 4 points so that the points from the first set lay at the vertexes of some square and the points from the second set lay at the vertexes of a rectangle. Each point of initial 8 should belong to exactly one set. It is acceptable for a rectangle from the second set was also a square. If there are several partitions, Petya will be satisfied by any of them. Help him find such partition. Note that the rectangle and the square from the partition should have non-zero areas. The sides of the figures do not have to be parallel to the coordinate axes, though it might be the case.
You are given 8 pairs of integers, a pair per line — the coordinates of the points Petya has. The absolute value of all coordinates does not exceed 10<sup class="upper-index">4</sup>. It is guaranteed that no two points coincide.
0 0
10 11
10 0
0 11
1 1
2 2
2 1
1 2
YES
5 6 7 8
1 2 3 4
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
NO
0 0
4 4
4 0
0 4
1 2
2 3
3 2
2 1
YES
1 2 3 4
5 6 7 8
-160 336
-76 672
8 168
-580 588
-1000 504
-496 840
-496 84
-664 0
YES
2 3 4 7
1 5 6 8
8 -328
-440 568
-104 8
-1000 -664
8 456
-328 8
-552 120
-664 -1000
YES
2 3 5 7
1 4 6 8
65 852
-645 284
-361 710
-1000 71
-219 284
207 426
-716 0
-929 355
YES
1 3 5 6
2 4 7 8
980 518
584 -670
-208 914
-736 -340
-604 -274
-1000 -736
-604 -1000
-340 -604
YES
1 2 3 5
4 6 7 8
48 264
144 240
24 0
168 48
120 144
0 72
144 120
24 168
YES
1 2 5 8
3 4 6 7
576 -616
192 -424
384 152
768 248
384 -1000
0 -808
480 -232
864 -136
YES
1 2 5 6
3 4 7 8
547 -167
-1000 -762
190 904
-762 -1000
-167 71
904 547
71 -167
-167 190
YES
1 3 6 8
2 4 5 7
-1000 -736
1200 408
1728 12
188 -1000
1332 -516
-736 -208
452 -472
804 -120
NO
210 140
140 0
210 210
455 140
70 210
525 385
0 70
280 455
YES
1 2 5 7
3 4 6 8
-1000 -829
-715 -601
311 197
197 -715
-829 -1000
-601 311
-658 -487
-487 -658
YES
2 3 4 6
1 5 7 8
329 -859
282 -765
376 81
0 -906
47 -1000
846 -577
940 -13
282 -483
YES
3 6 7 8
1 2 4 5
40 100
210 20
100 60
120 230
0 40
60 0
60 80
270 170
YES
1 3 5 6
2 4 7 8
-252 -1000
-1000 -932
-864 20
-796 -864
768 -388
-932 -796
-864 -1000
156 632
YES
2 4 6 7
1 3 5 8
351 234
234 741
234 351
702 819
117 0
0 117
312 273
780 351
YES
2 4 7 8
1 3 5 6
434 372
0 62
496 868
868 620
620 248
248 496
62 434
372 0
YES
3 4 5 6
1 2 7 8
-40 -1000
-440 120
2200 -200
1800 920
-200 -680
-840 120
-40 -360
-1000 -200
NO
-850 -1000
-475 -325
1025 800
-325 575
-325 -850
-1000 -475
-100 -775
1250 -550
YES
1 2 5 6
3 4 7 8
70 64
32 0
58 48
48 80
72 50
0 48
56 62
80 32
YES
1 3 5 7
2 4 6 8
937 937
-851 43
-404 1086
43 -106
788 -404
-553 -255
-1000 -851
-106 -1000
YES
1 3 5 6
2 4 7 8
-1 -223
554 110
-778 -1000
-667 -445
-1000 -667
-445 -778
443 -334
110 221
YES
3 4 5 6
1 2 7 8
1610 0
1700 270
-1000 -900
2105 315
800 0
-190 -900
1925 90
1880 495
NO
-360 120
600 440
-680 -40
440 600
-520 -360
-200 -200
-840 -1000
-1000 -840
YES
1 3 5 6
2 4 7 8
-11 220
-11 22
176 -66
-198 -22
-198 176
220 -198
0 88
44 -44
NO
378 504
504 504
126 0
504 126
0 378
252 546
294 798
546 756
YES
1 3 4 5
2 6 7 8
312 468
312 0
728 728
468 676
520 416
0 0
780 468
0 468
YES
3 4 5 7
1 2 6 8
180 100
180 220
80 0
240 760
0 80
100 180
720 160
780 700
YES
2 4 7 8
1 3 5 6
-1000 -742
1064 290
32 634
720 -742
-742 -226
-312 -398
-484 -1000
-226 -484
YES
2 3 4 6
1 5 7 8
-153 -238
-204 34
102 119
34 0
-663 -306
0 68
-612 -578
136 51
NO
-620 -1000
-1000 -620
976 672
-240 140
596 140
140 -240
1052 216
520 596
YES
3 5 7 8
1 2 4 6
203 232
232 348
58 0
0 58
319 203
290 232
348 319
232 290
YES
1 2 5 7
3 4 6 8
-328 260
-664 -1000
-1000 -496
92 -496
-1000 -1000
-664 -496
-496 -328
260 92
YES
1 4 7 8
2 3 5 6
-586 414
-931 0
-103 276
-448 897
-655 414
35 759
-586 345
-1000 69
YES
1 3 4 6
2 5 7 8
-424 920
-1000 152
344 -232
-232 536
-424 -1000
-616 -40
344 -616
536 728
YES
1 3 6 8
2 4 5 7
427 -451
549 -573
122 -1000
0 -85
183 -512
427 98
610 -329
0 -878
YES
4 5 6 7
1 2 3 8
89 -307
-109 -505
-10 89
-1000 -604
-505 -1000
-406 -10
-307 -406
-604 -109
YES
1 3 6 7
2 4 5 8
5 0
16 -54
9 5
0 4
0 -6
4 9
40 -24
-24 -36
NO
-845 860
-535 -225
-380 85
395 550
-225 -535
-1000 -690
-690 -1000
-70 1325
YES
1 3 4 8
2 5 6 7
702 628
-334 -408
-482 -852
850 -704
-408 -334
-926 -1000
-1000 -926
-630 480
YES
1 3 4 8
2 5 6 7
-465 -37
-465 -1000
177 -37
-144 177
-1000 -37
-1000 -1000
-358 -144
-37 -358
YES
3 4 7 8
1 2 5 6
-1000 176
408 88
-384 528
-648 704
-472 792
-736 0
-384 0
320 880
YES
2 5 7 8
1 3 4 6
-1000 786
-906 1256
-671 1021
-812 974
598 316
-765 1303
598 -1000
-1000 -530
NO
550 -70
-8 -597
-70 -628
-39 -690
-1000 -380
23 -659
-70 550
-380 -1000
YES
2 3 4 6
1 5 7 8
184 230
46 0
0 184
23 184
115 552
483 460
391 92
230 46
YES
4 5 6 7
1 2 3 8
692 -60
-812 316
128 880
-248 -624
-812 692
-1000 -1000
-1000 692
-812 -1000
YES
1 2 3 4
5 6 7 8
-1000 -852
-852 -1000
332 480
36 1812
184 2996
480 332
-408 776
-556 -408
NO
68 0
374 221
306 204
323 136
272 340
391 153
0 272
340 68
YES
2 3 4 6
1 5 7 8
296 -163
350 -190
-190 -1000
701 -730
782 -244
215 -649
-1000 -460
-460 350
YES
1 4 5 6
2 3 7 8
280 0
504 420
0 0
0 168
644 504
280 168
532 532
616 392
YES
2 5 7 8
1 3 4 6
728 656
584 152
1160 152
-1000 -1000
1016 944
-568 -424
1448 440
1016 728
NO
0 25
725 325
250 225
575 675
375 175
225 525
25 0
225 250
YES
2 4 5 6
1 3 7 8
116 488
-628 -1000
-70 -70
116 1604
-814 860
488 -628
860 674
-1000 116
YES
3 4 5 7
1 2 6 8
-208 -703
-109 -604
-406 -10
287 188
-208 -406
-1000 -802
-901 -1000
485 -505
YES
1 3 4 8
2 5 6 7
1136 602
1403 -21
-21 -911
-1000 424
-733 513
-288 -1000
780 -288
513 335
NO
760 980
1420 -120
320 -780
-1000 -560
100 -340
-340 320
-560 -1000
-340 100
YES
1 2 3 6
4 5 7 8
2843 260
3347 890
2780 827
1520 134
-1000 -874
2276 8
-244 -1000
3410 323
NO
0 336
112 476
196 448
336 0
560 896
140 560
224 532
896 560
YES
2 3 6 7
1 4 5 8
0 39
169 117
182 182
104 130
117 195
65 0
39 104
104 65
YES
2 3 4 5
1 6 7 8
-610 40
-1000 -220
-870 -1000
-220 352
-298 -350
-220 -90
92 -38
-90 -870
YES
1 4 5 7
2 3 6 8
560 140
0 140
280 280
560 700
420 560
700 560
140 0
700 420
YES
1 3 5 8
2 4 6 7
400 -580
-580 -895
-475 -720
-580 -1000
-405 -1000
-20 400
-300 -825
-1000 -20
YES
2 3 5 7
1 4 6 8
-736 -560
56 -560
-208 320
-736 -472
56 760
-648 320
-1000 -1000
144 232
NO
688 516
387 258
0 129
387 430
43 0
430 129
774 215
473 129
YES
1 4 7 8
2 3 5 6
-856 -1000
224 872
-136 8
584 656
8 512
368 296
8 -136
-1000 -856
YES
2 4 5 6
1 3 7 8
-880 0
400 -240
-640 480
-160 240
-240 480
-520 360
320 0
-1000 120
NO
58 0
0 58
377 145
261 203
203 261
406 29
290 0
261 116
YES
3 6 7 8
1 2 4 5
420 280
308 196
336 392
224 308
0 224
224 280
56 0
280 56
YES
1 2 3 4
5 6 7 8
136 -1000
544 -864
408 -456
816 156
340 88
884 -320
0 -592
408 -388
YES
1 2 3 7
4 5 6 8
920 -360
2088 200
-1000 600
2024 -56
1576 -184
1240 -1000
-680 -40
1512 -440
NO
528 660
792 660
660 528
528 0
0 132
330 462
132 0
990 198
YES
2 4 6 8
1 3 5 7
248 404
872 794
950 846
560 -1000
-1000 716
924 716
1002 768
-688 -688
NO
-656 0
-140 344
-140 516
-484 860
-1000 344
-54 946
204 602
-398 688
YES
2 6 7 8
1 3 4 5
744 -19
-1000 -782
-237 90
-128 -346
-346 -891
-891 -1000
635 -1000
-19 -564
YES
1 3 5 7
2 4 6 8
420 -664
0 -160
420 260
-840 -412
420 -580
-840 92
420 -160
0 -1000
NO
558 930
0 837
930 558
310 775
372 0
0 372
124 651
186 961
YES
2 4 7 8
1 3 5 6
-1000 448
120 448
876 224
1212 -84
36 588
372 280
-776 0
-104 896
NO
-320 904
3896 -184
224 224
3624 -48
-1000 360
-456 -320
-864 -864
-592 -1000
NO
302 488
-814 860
-70 984
-690 116
-814 -1000
488 302
54 240
-1000 -814
YES
2 3 4 7
1 5 6 8
0 0
4 -16
24 36
-60 60
-56 44
36 43
40 12
52 19
NO
-1000 282
-154 705
-859 0
974 846
833 141
128 282
-13 423
269 987
YES
4 5 6 8
1 2 3 7
20 -40
-40 60
-20 -15
100 -90
40 45
0 0
60 60
40 10
NO
-192 -192
-495 616
-1000 -596
414 -91
313 717
-394 -192
-798 -1000
10 -596
YES
2 4 5 6
1 3 7 8
-1000 -637
-516 -274
-274 -153
-32 -516
452 210
210 -516
-758 -1000
-274 452
YES
2 5 6 8
1 3 4 7
-799 407
-665 -531
-531 -866
-866 -1000
-263 -933
809 407
1345 -933
-1000 -665
NO
-1000 640
-16 640
312 -1000
968 -16
640 968
-672 -344
-672 -1000
968 -672
YES
2 3 4 6
1 5 7 8
-1000 -676
-136 -460
-460 188
188 80
-568 -460
-460 -136
-676 -1000
80 -568
YES
3 4 5 8
1 2 6 7
748 68
663 -34
0 680
425 0
663 -68
425 680
0 0
578 -170
NO
248 92
-1000 -792
-584 -376
-168 40
-116 -376
-792 -1000
-376 -584
300 -324
YES
1 4 5 8
2 3 6 7
140 42
126 84
-154 238
-420 406
14 0
0 42
-518 532
-56 112
NO
477 0
636 371
106 689
212 265
0 53
530 795
53 530
530 477
YES
2 3 4 6
1 5 7 8
0 -814
93 -256
372 -349
186 23
837 -628
744 -442
93 -1000
465 -70
YES
2 3 4 8
1 5 6 7
-832 -286
-748 -664
-916 -1000
302 -160
-328 344
-202 -790
-1000 -748
-664 -916
YES
1 4 5 6
2 3 7 8
25 10
0 10
41 34
5 0
39 30
37 36
35 32
20 20
YES
3 5 6 7
1 2 4 8
-522 -1000
912 1629
912 434
-283 1629
-1000 -283
195 -522
-283 195
-283 2824
NO
-586 -310
-310 104
104 -586
-172 -1000
-1000 -310
-724 -862
-34 -448
-586 -1000
YES
1 4 6 7
2 3 5 8
-445 -1
-556 -1000
554 443
-1000 -445
-445 -334
443 -445
-1 -556
-334 554
YES
1 2 4 7
3 5 6 8
-288 -822
-733 -110
-733 -1000
1047 -555
-1000 -911
780 780
-466 -199
-555 513
YES
1 4 6 8
2 3 5 7
2024 8
1352 -1000
1016 -244
512 344
1856 344
2360 -748
-1000 -664
344 -664
NO
-1000 -400
1190 450
1460 420
800 50
1250 -550
1100 360
1370 330
-550 -1000
NO
1175 450
-130 -1000
160 160
-1000 -1000
-1000 450
-130 450
1465 -565
450 -855
YES
1 3 7 8
2 4 5 6
424 -288
-1000 -466
68 246
246 1492
-644 -1000
-644 -110
-1000 1136
602 246
YES
4 6 7 8
1 2 3 5
-471 -80
-1000 35
-402 127
150 -885
-885 -1000
35 150
-333 -11
-540 58
YES
2 4 5 6
1 3 7 8
-400 -1000
-400 1000
600 400
400 1000
400 1200
-1000 -400
-200 200
1000 400
YES
2 3 5 7
1 4 6 8
292 1414
802 1312
-1000 -1000
462 2400
-184 -235
-847 326
-31 1091
972 2298
NO
0 0
8 12
14 4
0 10
7 5
5 10
15 11
5 0
YES
2 3 5 7
1 4 6 8
60 260
280 0
100 240
80 200
0 0
0 400
280 400
40 220
YES
1 3 4 8
2 5 6 7
-850 -1000
-1000 -850
-800 -250
250 -700
-50 50
-500 -1000
-650 -800
-800 -650
YES
3 4 5 6
1 2 7 8
-125 -825
1100 -475
400 -300
-1000 -475
-475 400
-650 -1000
50 225
750 750
YES
1 2 5 8
3 4 6 7
-725 1596
155 -1000
-758 1530
-571 1376
-1000 320
-692 1497
-659 1563
584 56
NO
-638 3887
-1000 1896
448 1353
-95 4430
-457 -1000
-276 4611
-95 4249
-819 4068
NO
216 0
828 504
648 612
504 432
756 792
288 576
0 144
936 684
YES
2 3 5 8
1 4 6 7
72 32
4 40
44 32
32 0
40 72
20 16
28 56
0 40
YES
2 3 6 7
1 4 5 8
457 -329
-530 611
-624 0
-953 658
-577 188
-859 -141
692 -188
-1000 235
NO
-841 -205
590 -205
-1000 -1000
-364 1385
-682 113
-841 -1000
-1000 -205
908 1067
YES
2 4 5 8
1 3 6 7
-1000 -604
-604 1112
-340 -736
452 1376
-604 -340
-736 -1000
716 320
-340 56
YES
1 3 5 6
2 4 7 8
-260 332
-112 776
776 184
-1000 -1000
-112 1368
-852 36
628 924
36 36
NO
600 0
460 600
500 960
0 200
660 760
300 800
100 500
700 300
YES
2 3 5 6
1 4 7 8
15 160
-101 334
-855 -1000
-275 -101
-1000 -855
160 15
160 -275
334 160
YES
2 4 7 8
1 3 5 6
0 108
216 144
480 360
0 0
60 108
240 192
60 0
-24 -24
NO
344 -200
-200 -520
-680 -1000
280 -8
-1000 -680
536 -136
-520 -200
472 56
YES
1 4 6 8
2 3 5 7
270 2024
-486 -1000
-162 2672
162 2888
540 728
918 1862
-864 1160
486 2510
NO
0 336
128 80
240 272
0 0
368 -112
128 -256
144 96
464 64
NO
-526 -447
-1000 -526
-526 -1000
-131 -131
-368 106
185 -526
-210 -842
106 -368
YES
1 4 6 7
2 3 5 8
648 440
720 -1000
0 -280
-120 1520
-840 2240
720 488
672 560
600 512
NO
-1000 568
-432 639
278 710
-929 0
-361 355
-361 71
-219 852
136 213
YES
1 2 4 6
3 5 7 8
-520 480
-40 240
-1000 240
240 360
-400 240
-160 520
-880 0
120 640
YES
2 4 6 8
1 3 5 7
270 225
297 387
315 135
387 315
45 0
0 90
225 297
315 225
YES
2 4 7 8
1 3 5 6
60 30
0 18
24 6
81 36
75 57
18 24
54 51
6 0
YES
1 4 5 7
2 3 6 8
134 -496
-496 -118
-748 8
-1000 -748
8 -244
-370 134
-622 260
-874 -1000
YES
2 3 6 7
1 4 5 8
1538 -718
-1000 -718
3277 -13
3089 645
3747 833
-718 -1000
3935 175
1820 -1000
NO
116 232
87 0
319 116
203 174
58 145
174 0
203 261
0 58
YES
3 5 6 7
1 2 4 8
-912 -296
672 -560
-472 -296
-648 -208
-648 1288
-824 -1000
-1000 -912
936 1024
YES
1 2 5 8
3 4 6 7
428 -796
-592 -1000
666 3318
-1000 1856
190 2842
462 3454
394 2706
20 2060
NO
684 399
0 228
570 342
228 285
342 0
228 570
570 855
114 741
YES
2 3 5 6
1 4 7 8
-1000 -373
254 1090
-791 672
463 -164
-373 -373
-373 -1000
-164 463
672 45
YES
2 3 5 8
1 4 6 7
-536 -304
-536 508
-768 -188
-768 -1000
-1000 -768
160 276
-72 -420
-304 -536
YES
2 3 6 7
1 4 5 8
120 30
200 160
130 0
150 40
40 200
0 40
160 10
160 0
YES
1 3 4 7
2 5 6 8
595 -159
421 -565
-275 -1000
-275 -420
189 15
-1000 -1000
-1000 -420
15 -391
YES
1 2 5 8
3 4 6 7
6 40
0 35
4 50
5 0
35 40
40 5
10 46
0 44
YES
2 4 5 6
1 3 7 8
360 300
210 240
240 90
180 210
150 390
300 450
0 120
60 0
YES
1 2 5 6
3 4 7 8
434 116
434 426
-186 -1000
-186 -256
0 116
434 -628
62 54
372 488
NO
520 -325
260 0
650 -455
0 195
130 390
195 455
455 260
260 260
NO
189 135
261 153
0 54
81 0
234 108
216 180
135 81
54 135
YES
1 2 5 6
3 4 7 8
864 -540
972 -162
342 216
0 -324
108 54
468 378
486 234
324 360
NO
265 220
30 -60
330 -420
140 110
15 0
140 200
15 90
345 -480
NO
94 112
-190 360
-280 0
0 0
94 84
74 76
114 120
90 360
NO
234 104
0 52
286 104
598 624
208 156
182 520
26 0
702 208
YES
3 4 6 8
1 2 5 7
0 304
456 532
532 304
456 76
304 380
152 0
608 228
228 152
YES
3 4 5 8
1 2 6 7
517 551
940 786
376 -13
799 -1000
-94 -154
329 -906
329 81
-94 81
NO
117 0
195 312
312 195
0 117
312 663
195 390
468 273
585 546
YES
5 6 7 8
1 2 3 4
646 102
238 136
102 510
136 0
578 578
102 238
0 102
170 34
YES
2 4 6 7
1 3 5 8
-856 -1000
440 728
728 296
-1000 -856
296 8
-424 -280
-280 -424
8 440
YES
2 3 5 8
1 4 6 7
160 120
180 120
340 140
20 0
320 300
180 40
160 280
0 80
YES
2 3 5 7
1 4 6 8
195 260
533 390
455 546
0 65
260 195
65 0
689 468
611 624
YES
2 3 7 8
1 4 5 6
123 0
-410 123
902 -123
-82 369
123 492
0 492
574 -369
0 0
NO
42 -168
966 252
462 126
840 756
336 630
0 -588
-252 -168
-294 -588
NO
280 480
360 -80
-1000 -640
-200 -160
-760 -1000
-280 -160
-280 400
-40 -520
YES
1 2 4 7
3 5 6 8
-622 315
-1000 126
-937 0
-55 315
-559 189
-433 441
-307 819
71 693
YES
4 6 7 8
1 2 3 5
410 533
287 41
615 164
328 246
697 451
246 287
0 246
41 0
YES
1 3 4 5
2 6 7 8
-919 0
53 648
-514 405
-433 729
-1000 162
-28 162
-433 243
-514 243
YES
2 4 6 8
1 3 5 7
-1000 276
-586 828
-34 414
104 414
-862 690
-448 276
-34 966
-172 0
YES
2 4 6 7
1 3 5 8
-544 -316
140 368
-1000 -772
-316 -544
-316 596
-544 140
-88 -88
-772 -1000
YES
2 5 6 7
1 3 4 8
980 -520
860 -430
620 -250
500 -160
20 1220
-1000 980
380 -760
-640 -1000
NO
432 -1000
0 -1000
0 -520
432 -520
864 104
192 8
960 -568
288 -664
YES
5 6 7 8
1 2 3 4
872 872
-766 -1000
170 -64
1808 989
1925 53
989 -64
-64 170
-1000 -766
YES
1 4 5 6
2 3 7 8
-620 -1000
-430 -240
45 -240
-810 -145
-145 520
-715 -430
-905 330
-1000 -905
YES
3 5 6 7
1 2 4 8
-316 684
-1000 -228
444 76
520 152
1204 380
-316 0
-240 0
368 760
NO
364 -688
-260 248
-312 40
0 -532
0 -792
104 -792
260 -428
-52 -1000
NO
96 180
-204 108
-144 36
84 102
-12 0
0 6
-72 72
12 84
NO
357 -1000
119 190
714 -48
0 -643
833 -524
952 547
476 -167
357 785
YES
2 3 6 8
1 4 5 7
598 368
414 92
0 0
138 46
368 322
644 138
138 0
0 46
YES
1 2 5 6
3 4 7 8
-480 -350
-1000 -870
-870 -1000
-155 495
-740 -285
40 -870
625 -90
-350 -480
YES
4 5 6 7
1 2 3 8
-340 1640
-1000 650
320 375
705 485
815 100
430 -10
-340 -10
-1000 -1000
NO
120 120
105 30
30 0
0 75
75 90
90 165
75 105
45 135
YES
2 3 4 7
1 5 6 8
840 980
140 532
980 840
588 420
700 868
252 980
140 0
0 140
YES
2 4 5 6
1 3 7 8
-244 -730
512 998
-460 -946
728 1214
-1000 -568
728 -892
80 -1000
-352 -460
NO
62 60
54 50
6 42
64 42
0 6
36 0
72 52
42 36
YES
1 2 4 7
3 5 6 8
-941 -1000
-764 -410
-823 -882
-882 -823
-1000 -941
1006 298
475 -941
-233 829
YES
2 6 7 8
1 3 4 5
360 648
504 360
0 360
648 288
288 504
648 576
288 0
432 720
YES
1 3 4 7
2 5 6 8
792 -648
-352 -142
704 -1000
88 -472
0 -824
-682 1046
572 -208
242 980
NO
-1000 176
100 616
-824 0
-780 396
-252 88
-780 440
-428 968
-604 220
YES
2 5 6 7
1 3 4 8
-1000 -580
-1000 -1000
330 960
610 260
-860 -580
120 470
-860 -1000
820 750
YES
3 4 6 8
1 2 5 7
0 -970
90 -580
585 500
150 -880
270 -400
30 -1000
405 320
120 -850
NO
600 500
700 200
600 180
620 100
700 120
100 0
680 200
0 300
YES
3 4 5 7
1 2 6 8
256 496
304 512
576 0
320 464
272 448
0 64
64 640
640 576
YES
1 2 4 5
3 6 7 8
128 112
40 72
64 96
72 40
80 32
32 0
0 32
144 48
YES
1 3 5 8
2 4 6 7
-1000 1052
140 -392
292 -1000
900 -848
-12 368
672 -544
748 -240
-316 140
NO
-208 -10
188 -208
386 188
-505 -1000
-505 -703
-10 386
-1000 -1000
-1000 -703
YES
1 2 3 6
4 5 7 8
153 102
187 170
102 153
153 68
0 51
221 102
51 0
119 136
YES
2 4 6 8
1 3 5 7
-1000 -60
-342 -1000
1444 -248
1162 -718
1538 -624
1914 -530
786 692
2290 -436
NO
3368 858
-1000 -546
1886 0
3914 702
3602 429
3056 585
-298 -780
2588 -234
NO
780 68
424 -466
68 -110
246 424
246 -466
-110 -110
-822 -1000
-1000 -644
YES
1 2 4 6
3 5 7 8
-372 93
-403 31
31 -31
558 186
248 434
279 155
0 -93
527 465
NO
-859 329
-1000 141
81 705
-906 0
-577 987
-718 329
-624 188
-201 47
YES
1 3 5 8
2 4 6 7
-97 -140
290 -97
290 935
935 290
-1000 -355
-140 247
247 290
-355 -1000
YES
1 2 6 7
3 4 5 8
426 518
-609 449
633 -1000
-586 2220
-954 2174
-632 2588
-1000 2542
-816 1967
NO
410 -754
574 312
82 66
820 -180
410 -1000
0 -1000
328 -426
0 -754
YES
2 3 4 7
1 5 6 8
-700 120
-370 -90
-40 510
-490 150
-1000 -60
-670 -270
-850 600
-400 960
NO
100 100
100 101
101 100
101 101
0 0
0 5
10 5
0 -10
NO
100 100
100 101
101 100
101 101
0 0
0 5
10 5
6 2
NO
100 100
100 101
101 100
101 101
0 0
1 5
11 5
10 0
NO
0 0
1 0
0 1
1 1
100 100
100 101
101 100
101 101
YES
1 2 3 4
5 6 7 8
0 8
-2 0
-3 0
0 -8
2 0
3 0
0 2
0 -2
NO
-8 0
0 -3
8 0
10000 10000
9999 9999
9999 10000
0 3
10000 9999
NO
-8 0
0 -3
8 0
10000 10000
9998 9999
9998 10000
0 3
10000 9999
NO
10 10
15 11
15 9
20 10
100 100
100 102
107 102
107 100
NO
0 0
5 0
8 4
3 4
-2 -2
-2 -1
-1 -1
-1 -2
NO
0 0
1 1
2 2
3 3
4 4
4 5
5 4
5 5
NO
0 0
0 1
1 0
1 1
10 10
14 10
12 16
12 20
NO
0 0
0 1
1 0
1 1
2 0
2 1
3 1
4 0
NO
1 1
1 2
2 1
2 2
100 100
101 100
101 102
102 102
NO
0 0
2 0
2 2
0 2
1 1
5 0
5 2
9 1
NO
0 0
0 1
1 0
1 1
2 2
3 2
3 3
4 3
NO
4 1
7 3
9 4
4 5
1 3
9 6
12 4
12 6
NO
0 0
3 0
3 4
6 4
100 100
101 100
100 101
101 101
NO
1 0
0 4
2 4
1 8
15 15
15 16
18 15
18 16
NO
0 0
0 1
1 1
1 0
1000 1000
1001 1003
1004 1004
1003 1001
NO
1 0
2 2
0 2
1 4
7 0
9 0
7 1
9 1
NO
0 0
1 0
1 1
0 1
5 6
100 190
6 7
10 196
NO
0 0
1 0
2 0
1 2
50 50
50 51
51 51
51 50
NO
N = 8
x = [0] * N
y = [0] * N

for p in range(N):
    x[p], y[p] = map(int, input().split())

def check_conditions(points, square, rectangle):
    dx = [points[square[(i + 1) % 4]][0] - points[square[i]][0] for i in range(4)]
    dy = [points[square[(i + 1) % 4]][1] - points[square[i]][1] for i in range(4)]
    return (dx[0] * dy[2] == dy[0] * dx[2]) and (dx[1] * dy[3] == dy[1] * dx[3]) and \
           (dx[0] * dx[1] + dy[0] * dy[1] == 0) and \
           (dx[0] * dx[0] + dy[0] * dy[0] == dx[1] * dx[1] + dy[1] * dy[1])

possible = False
for square in itertools.permutations(range(N), 4):
    rectangle = [p for p in range(N) if p not in square]
    if check_conditions((x, y), square, rectangle):
        possible = True
        break

if possible:
    print("YES")
    print(' '.join(str(p + 1) for p in square))
    print(' '.join(str(p + 1) for p in rectangle))
else:
    print("NO")
