Vasya is choosing a laptop. The shop has *n* laptops to all tastes.

Vasya is interested in the following properties: processor speed, ram and hdd. Vasya is a programmer and not a gamer which is why he is not interested in all other properties.

If all three properties of a laptop are strictly less than those properties of some other laptop, then the first laptop is considered outdated by Vasya. Among all laptops Vasya does not consider outdated, he chooses the cheapest one.

There are very many laptops, which is why Vasya decided to write a program that chooses the suitable laptop. However, Vasya doesn't have his own laptop yet and he asks you to help him.
The first line contains number *n* (1 ≤ *n* ≤ 100).

Then follow *n* lines. Each describes a laptop as *speed* *ram* *hdd* *cost*. Besides, 
 -  *speed*, *ram*, *hdd* and *cost* are integers -  1000 ≤ *speed* ≤ 4200 is the processor's speed in megahertz -  256 ≤ *ram* ≤ 4096 the RAM volume in megabytes -  1 ≤ *hdd* ≤ 500 is the HDD in gigabytes -  100 ≤ *cost* ≤ 1000 is price in tugriks 
All laptops have different prices.
5
2100 512 150 200
2000 2048 240 350
2300 1024 200 320
2500 2048 80 300
2000 512 180 150
4
2
1500 500 50 755
1600 600 80 700
2
2
1500 512 50 567
1600 400 70 789
1
4
1000 300 5 700
1100 400 10 600
1200 500 15 500
1300 600 20 400
4
10
2123 389 397 747
2705 3497 413 241
3640 984 470 250
3013 2004 276 905
3658 3213 353 602
1428 626 188 523
2435 1140 459 824
2927 2586 237 860
2361 4004 386 719
2863 2429 476 310
2
25
2123 389 397 747
2705 3497 413 241
3640 984 470 250
3013 2004 276 905
3658 3213 353 602
1428 626 188 523
2435 1140 459 824
2927 2586 237 860
2361 4004 386 719
2863 2429 476 310
3447 3875 1 306
3950 1901 31 526
4130 1886 152 535
1951 1840 122 814
1798 3722 474 106
2305 3979 82 971
3656 3148 349 992
1062 1648 320 491
3113 3706 302 542
3545 1317 184 853
1277 2153 95 492
2189 3495 427 655
4014 3030 22 963
1455 3840 155 485
2760 717 309 891
15
1
1200 512 300 700
1
1
4200 4096 500 1000
1
1
1000 256 1 100
1
2
2000 500 200 100
3000 600 100 200
1
2
2000 500 200 200
3000 600 100 100
2
2
2000 600 100 100
3000 500 200 200
1
2
2000 700 100 200
3000 500 200 100
2
2
3000 500 100 100
1500 600 200 200
1
2
3000 500 100 300
1500 600 200 200
2
3
3467 1566 191 888
3047 3917 3 849
1795 1251 97 281
2
4
3835 1035 5 848
2222 3172 190 370
2634 2698 437 742
1748 3112 159 546
2
5
3511 981 276 808
3317 2320 354 878
3089 702 20 732
1088 2913 327 756
3837 691 173 933
4
6
1185 894 287 455
2465 3317 102 240
2390 2353 81 615
2884 603 170 826
3202 2070 320 184
3074 3776 497 466
5
7
3987 1611 470 720
1254 4048 226 626
1747 630 25 996
2336 2170 402 123
1902 3952 337 663
1416 271 77 499
1802 1399 419 929
4
10
3888 1084 420 278
2033 277 304 447
1774 514 61 663
2055 3437 67 144
1237 1590 145 599
3648 663 244 525
3691 2276 332 504
1496 2655 324 313
2462 1930 13 644
1811 331 390 284
4
13
3684 543 70 227
3953 1650 151 681
2452 655 102 946
3003 990 121 411
2896 1936 158 155
1972 717 366 754
3989 2237 32 521
2738 2140 445 965
2884 1772 251 369
2240 741 465 209
4073 2812 494 414
3392 955 425 133
4028 717 90 123
11
17
3868 2323 290 182
1253 3599 38 217
2372 354 332 897
1286 649 332 495
1642 1643 301 216
1578 792 140 299
3329 3039 359 525
1362 2006 172 183
1058 3961 423 591
3196 914 484 675
3032 3752 217 954
2391 2853 171 579
4102 3170 349 516
1218 1661 451 354
3375 1997 196 404
1030 918 198 893
2546 2029 399 647
14
22
1601 1091 249 107
2918 3830 312 767
4140 409 393 202
3485 2409 446 291
2787 530 272 147
2303 3400 265 206
2164 1088 143 667
1575 2439 278 863
2874 699 369 568
4017 1625 368 641
3446 916 53 509
3627 3229 328 256
1004 2525 109 670
2369 3299 57 351
4147 3038 73 309
3510 3391 390 470
3308 3139 268 736
3733 1054 98 809
3967 2992 408 873
2104 3191 83 687
2223 2910 209 563
1406 2428 147 673
3
27
1689 1927 40 270
3833 2570 167 134
2580 3589 390 300
1898 2587 407 316
1841 2772 411 187
1296 288 407 506
1215 263 236 307
2737 1427 84 992
1107 1879 284 866
3311 2507 475 147
2951 2214 209 375
1352 2582 110 324
2082 747 289 521
2226 1617 209 108
2253 1993 109 835
2866 2360 29 206
1431 3581 185 918
3800 1167 463 943
4136 1156 266 490
3511 1396 478 169
3498 1419 493 792
2660 2165 204 172
3509 2358 178 469
1568 3564 276 319
3871 2660 472 366
3569 2829 146 761
1365 2943 460 611
10
2
1000 2000 300 120
1000 2000 300 130
1
10
2883 1110 230 501
2662 821 163 215
2776 1131 276 870
2776 1131 276 596
2776 1131 276 981
2662 821 163 892
2662 821 163 997
2883 1110 230 132
2776 1131 276 317
2883 1110 230 481
8
23
1578 3681 380 163
2640 3990 180 576
3278 2311 131 386
3900 513 443 873
1230 1143 267 313
2640 3990 180 501
1230 1143 267 428
1578 3681 380 199
1578 3681 380 490
3900 513 443 980
3900 513 443 882
3278 2311 131 951
3278 2311 131 863
2640 3990 180 916
3278 2311 131 406
3278 2311 131 455
3278 2311 131 239
1230 1143 267 439
3900 513 443 438
3900 513 443 514
3278 2311 131 526
1578 3681 380 123
1578 3681 380 263
22
6
2100 512 150 200
2000 2048 240 350
2300 1024 200 320
2500 2048 80 300
2000 512 180 150
1000 256 1 100
4
2
1000 256 1 100
1000 256 1 101
1
2
1500 500 300 1000
1500 500 300 900
2
4
1000 256 1 500
1000 256 1 400
1000 256 1 300
1000 256 1 200
4
3
1500 1024 300 150
1200 512 150 100
1000 256 50 200
1
n = int(input())
s = [[int(i) for i in input().split()] for i in range(n)]
speed,ram,hdd=0,0,0
num = 1001
ans = 0
for i in s:
	speed = max(speed,i[0])
	ram = max(ram,i[1])
	hdd = max(hdd,i[2])

for i in range(n):
	if s[i][0]==speed or s[i][1]==ram or s[i][2]==hdd:
		if s[i][3]<num:
			num = s[i][3]
			ans = i+1
print(ans)