#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
using namespace std;

#define F first
#define S second
typedef pair<int, int> P;

int n;
P dat[100010 * 4];

void update(int id, int a){
  int k = id;
  k += n - 1;
  dat[k].F += a;
  dat[k].S = -id;

  while(k > 0){
    k = (k - 1) / 2;
    dat[k] = max(dat[k * 2 + 1], dat[k * 2 + 2]);
  }
}

void init(int n_){
  n = 1;
  while(n < n_) n *= 2;

  for(int i = 0;i < n_; i++) update(i, 0);
}
/*
P query(int a, int b, int k, int l, int r){
  P p;
  p.F = 0; p.S = 0;
  if(r <= a || b <= l) return p;

  if(a <= l && r <= b) return dat[k];
  else{
    P vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    P vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return max(vl, vr);
  }
}
*/

int main(void)
{
  int N, r, l;
  int d, t, x;
  int max_idx = 0;
  int prev_t = 0, time[100010] = {0};
  P p; //p.S = -1;

  scanf("%d %d %d", &N, &r, &l);
  init(N);

  for(int i = 0;i < r; i++){
    scanf("%d %d %d", &d, &t, &x);
    d--;
    //p = query(1, N + 1, 0, 0, n);
    p = dat[0];
    time[-p.S] += t - prev_t;
    update(d, x);
    prev_t = t;
  }
  //p = query(1, N + 1, 0, 0, n);
  p = dat[0];
  time[-p.S] += l - prev_t;
  for(int i = 0;i < N; i++){
    //printf("%d\n", time[i]);
    if(time[max_idx] < time[i])
      max_idx = i;
  }
  printf("%d\n", max_idx + 1);
}
