N, R, L = gets.split.map(&:to_i)
time = Array.new(N, 0)
score = Array.new(N, 0)
lastTime = 0
R.times do
  d, t, x = gets.split.map(&:to_i)
  time[score.index(score.max)] += t - lastTime
  lastTime = t
  score[d-1] += x
end
time[score.index(score.max)] += L - lastTime
p time.index(time.max) + 1