import std.stdio;
import std.algorithm;
import std.string;
import std.conv;
import std.array;
import std.typecons;
import std.container;


class Team {
	int point;
	int time;
	int id;
}

void main() {
	auto inp = readln.split.map!(to!int);
	int N = inp[0], R = inp[1], L = inp[2];
	Team[] datas = new Team[N];
	foreach (i; 0..N) {
		datas[i] = new Team;
		datas[i].id = i;
	}
	Team[] rank = new Team[N];
	foreach (i; 0..N) {
		rank[i] = datas[i];
	}
	int t = 0;
	foreach (i; 0..R) {
		auto input = readln.split.map!(to!int).array;
		input[0]--;
		auto target = datas[input[0]];
		target.point += input[2];
		auto t2 = input[1];
		if (i > 0) datas[rank[0].id].time += t2 - t;
		sort!((a, b)=> a.point > b.point || (a.point == b.point && a.id < b.id))(rank);
		t = t2;
	}
	datas[rank[0].id].time += L - t;
	int max = 0;
	int maxId = 0;
	foreach(i; 0..N) {
		if (datas[i].time > max) {
			max = datas[i].time;
			maxId = i;
		}
	}
	writeln(maxId+1);
}