1. 

/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10038 (Jolly Jumpers)
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=979
*
* @author Christian Posselt
* @author Jonathan Schubert
* @version 1.0, 05/08/2009
*
* Status : Accepted
* Runtime: 0.244
*/

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;


public class Main {

public static void main (String[] args) throws IOException
{

BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer tokenizer;
StringBuilder answer = new StringBuilder();
String line;
ArrayList<Integer> numbers;
ArrayList<Integer> diffs;
int amount;
boolean hasAll;

while(true)
{
line = reader.readLine();

if(line == null || line.equals("0"))
break;

numbers = new ArrayList<Integer>();
diffs = new ArrayList<Integer>();
tokenizer = new StringTokenizer(line," ");
hasAll = true;

//save all numbers
while(tokenizer.hasMoreTokens())
numbers.add(Integer.parseInt(tokenizer.nextToken()));

//calculate all absolute differences
for(int i=0;i<numbers.size()-1;i++)
diffs.add(Math.abs(numbers.get(i)-numbers.get(i+1)));

amount = numbers.size()-1;

//test, if diffs contains all necessary differences
for(int i=1;i<amount;i++)
if(!(diffs.contains(i)))
{
hasAll = false;
break;
}

if(hasAll || numbers.size()==1)
{
answer.append("Jolly");
answer.append("\n");
}
else
{
answer.append("Not jolly");
answer.append("\n");
}

}

System.out.print(answer.toString());
}

}