#include <iostream>
#include <cstdio>
#include <vector>
#include <cassert>
using namespace std;

const int ALPH_SIZE = 26;                       

bool win(int size, int evens)
{
    if (size == ALPH_SIZE - evens)
        return false;
    bool res = false;
    if (evens > 0)
        res |= !win(size - 1, evens - 1);
    if (evens < ALPH_SIZE)
        res |= !win(size - 1, evens + 1);
    return res;
}

int main()
{
    freopen("duty.in", "r", stdin);
    freopen("duty.out", "w", stdout);
    string s;
    cin >> s;
    vector<int> cnt(ALPH_SIZE, 0);
    int n = s.size();
    for (int i = 0; i < n; i++)
        cnt[s[i] - 'a']++;
    int evens = 0;
    for (int i = 0; i < ALPH_SIZE; i++)
        if (cnt[i] % 2 == 0)
            evens++;
    if (win(s.size(), evens))
        cout << "Grisha" << endl;
    else
        cout << "Dima" << endl;
    return 0;
} 