// Arup Guha
// Solution to Proposed 2017 NAQ Problem: Canonical Coins
// 8/9/2017

import java.util.*;

public class canonicalcoins_arup {

	public static void main(String[] args) {

		// Read in the input.
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		int[] denom = new int[n];
		for (int i=0; i<n; i++)
			denom[i] = stdin.nextInt();
		int max = denom[n-1]*2;

		// Initialize best answers to all be pennies.
		int[] dp = new int[max+1];
		for (int i=0; i<dp.length; i++) dp[i] = i;

		// Fill in each best answer.
		for (int i=2; i<=max; i++) {

			// Try each coin as your next one, to build the best answer.
			for (int j=0; j<n; j++) {
				if (denom[j] > i) break;
				dp[i] = Math.min(dp[i], dp[i-denom[j]]+1);
			}
		}

		// Now, calculate the greedy answers.
		int[] greedy = new int[max+1];
		greedy[1] = 1;
		for (int i=2; i<=max; i++) {
			int j = n-1;
			while (denom[j] > i) j--;
			greedy[i] = greedy[i-denom[j]] + 1;
		}

		// See if all are the same.
		boolean ok = true;
		for (int i=0; i<=max; i++)
			if (greedy[i] != dp[i])
				ok = false;

		// Output result.
		if (ok)
			System.out.println("canonical");
		else
			System.out.println("non-canonical");
	}
}