#include <bits/stdc++.h>

#define rep_(v, f, l) for (int v = (f); v < (l); ++v)
#define rep(v, n) rep_(v, 0, n)
#define lep(v, n) rep_(v, 1, n + 1)

using namespace std;

typedef long long int lint;

struct SegTree {
    static const int N=1<<17;
    vector<int> score;
    vector<int> id;
    SegTree() : score(N*2, 0), id(N*2, 0) {
        rep(i, N){
            id[i+N-1]=i;
        }
    }
    void update(int x, int v){
        x += N - 1;
        score[x] += v;
        while (x){
            x = x - 1 >> 1;
            if (score[x + x + 1] >= score[x + x + 2]){
                id[x] = id[x + x + 1];
                score[x] = score[x + x + 1];
            }
            else {
                id[x] = id[x + x + 2];
                score[x] = score[x + x + 2];
            }
        }
    }
    int getMax(){ return id[0]; }
    int getMaxValue(){ return score[0]; }
};

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

int main()
{
    SegTree st = SegTree();
    int n, r, l;
    int tv_time[100000]={};
    n = in();
    r = in();
    l = in();
    int prev_t = 0;
    rep(i, r){
        int d, t, x;
        d = in() - 1;
        t = in();
        x = in();
        tv_time[st.getMax()] += t - prev_t;
        prev_t = t;
        st.update(d, x);
    }
    tv_time[st.getMax()] += l - prev_t;
    int id = 0;
    rep(i, n){
        if (tv_time[id] < tv_time[i]) id = i;
    }
    printf("%d\n", id + 1);
    return (0);
}