// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstring>

#include <cstdlib>

#include <cmath>

#include <vector>

#include <string>

#include <map>

#include <set>

#include <queue>

#include <stack>

#include <algorithm>



using namespace std;



#define rep(i,j) REP((i), 0, (j))

#define REP(i,j,k) for(int i=(j);(i)<(k);++i)

#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))

#define ALL(v) (v).begin(), (v).end()

#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))

#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)

#define MP make_pair

#define PB push_back

#define F first

#define S second

#define INF 1 << 30

#define EPS 1e-10

#define MAX_N 200000



typedef long long ll;

typedef pair<ll, ll> P;

typedef pair<int, P> pii;

typedef vector<int> vi;

typedef queue<int> qi;



struct segtree{

  int N;

  P dat[2 * MAX_N - 1];

  segtree(){}

  segtree(int n){

    N = 1;

    while(n > N) N *= 2;



    rep(i, 2 * N - 1) dat[i] = MP(-10000000, -10000000);

    for(int i = N - 1; i < 2 * N - 1; i++) dat[i] = MP(0, -1 * (i - N + 1));

  }



  void update(int k, int a){

    k += N - 1;

    dat[k].F += a;

    while(k > 0){

      k = (k - 1) / 2;

      dat[k] = max(dat[k*2+1], dat[2*k+2]);

    }

  }



  P query(int a, int b){ return query(a, b, 0, 0, N); }

  P query(int a, int b, int k, int l, int r){

    if(r <= a || b <= l) return P(-10000000, -10000000);



    if(a <= l && r <= b) return dat[k];

    else{

      P vl = query(a, b, 2*k+1, l, (l+r)/2);

      P vr = query(a, b, 2*k+2, (l+r)/2, r);

      return max(vl, vr);

    }

  }

};



int res[MAX_N];



int main(){

  int N, R, L;

  scanf("%d%d%d", &N, &R, &L);

  segtree seg(N);

  rep(i, N) seg.update(i, 0);



  int time = 0;

  rep(i, R){

    int d, t, x;

    scanf("%d%d%d", &d, &t, &x); d--;

    P s = seg.query(0, N);

    res[-s.second] += t - time;

    seg.update(d, x);

    time = t;

  }

  P s = seg.query(0, N);

  res[-s.second] += L - time;



  int ans = 0;

  rep(i, N) if(res[ans] < res[i]) ans = i;



  printf("%d\n", ans+1);

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 7.798641639736281x):
#include <iostream>

#include <cstdio>

#include <cstdlib>

#include <queue>

#include <algorithm>



using namespace std;



#define rep(i,j) REP((i), 0, (j))

#define REP(i,j,k) for(int i=(j);(i)<(k);++i)

#define MP make_pair

#define F first

#define S second



typedef pair<int, int> P;



int N, R, L;

int point[100005];

int res[100005];



int main(){

  scanf("%d%d%d", &N, &R, &L);

  int now = 0;



  priority_queue<P>q;

  rep(i, N) q.push(P(0, -i));

  rep(i, R){

    //    printf("%d\n", i);



    int d, t, x;

    scanf("%d%d%d", &d, &t, &x);d--;

    //    printf("%d %d %d\n", d, t, x);



    //    printf("%d\n", i);

    P p = q.top(); q.pop();

    while(p.F != point[-p.S]){

      p = q.top(); q.pop();

    }

    q.push(p);



    res[-p.S] += t - now;

    now = t;



    point[d] += x;

    //    printf("%d\n", d);

    //    rep(j, N) printf("%d ", point[j]); puts("");

    q.push(P(point[d], -d));

  }



  P p = q.top(); q.pop();

  while(p.F != point[-p.S]){

    //    printf("%d %d\n", p.F, point[-p.S]);

    p = q.top(); q.pop();

  }

  //  printf("%d %d\n", p.F, point[-p.S]);

  res[-p.S] += L - now;



  //  rep(i, N) printf("%d ", res[i]); puts("");

  int team = 0;

  rep(i, N) if(res[team] < res[i]) team = i;

  printf("%d\n", team+1);

  exit(0);

  return (0);

}