def aqilevel(aqi):
    """Return AQI level (g,y,o,r,p,m)."""
    aqi = int(aqi)
    if aqi <= 50:
        return 'g'
    elif aqi <= 100:
        return 'y'
    elif aqi <= 150:
        return 'o'
    elif aqi <= 200:
        return 'r'
    elif aqi <= 300:
        return 'p'
    else:
        return 'm'