Suppose I have the following df.

```
df = pd.DataFrame({
    'A':['x','y','x','y'],
    'B':['a','b','a','b'],
    'C':[1,10,100,1000],
    'D':['w','v','v','w']
})

    A   B   C       D
0   x   a   1       w
1   y   b   10      v
2   x   a   100     v
3   y   b   1000    w

```

I want to group by columns A and B, sum column C, and keep the value from D which is the same row of the maximum group value of C. Like this:

```
A   B   C      D
x   a   101    v
y   b   1010   w

```

So far, I have this:

```
df.groupby(['A','B']).agg({'C':sum})

A   B   C
x   a   101
y   b   1010

```

What function do I have to aggregate column D with?