// Задача "Число-палиндром"
// 10-ая Интернет-олимпиада сезона 2006-2007, базовый уровень
// Автор задачи: Федор Царев, tsarev@rain.ifmo.ru
// Автор решения: Федор Царев, tsarev@rain.ifmo.ru

import java.io.*;
import java.util.*;

public class number_ft implements Runnable {

	private Scanner in;
	private PrintWriter out;

	private final static int MAXN = 2000;

	private void myAssert(boolean e) {
		if (!e) {
			throw new Error("Assertion failure!!!");
		}
	}

	String reverse(String s) {
		String res = "";
		for (char ch : s.toCharArray()) {
			res = ch + res;
		}
		return res;
	}

	private void solve() throws IOException {
		int n = in.nextInt();
		myAssert(1 <= n && n <= 1000000000);
		boolean[] w = new boolean[37];
		for (int i = 2; i <= 36; i++) {
			String cur = Integer.toString(n, i);
//			System.out.println(cur);
			if (cur.equals(reverse(cur))) {
				w[i] = true;
			}
		}
		int cnt = 0;
		for (int i = 2; i <= 36; i++) {
			if (w[i]) {
				cnt++;
			}
		}
		if (cnt == 0) {
			out.println("none");
		} else {
			if (cnt == 1) {
				out.println("unique");
			} else {
				out.println("multiple");
			}
			for (int i = 2; i <= 36; i++) {
				if (w[i]) {
					out.print(i + " ");
				}
			}
			out.println();
		}
	}

	public void run() {
		try {
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.close();
		}
	}
	
	private number_ft(String name) {
		try {
			in = new Scanner(new File(name + ".in"));
			out = new PrintWriter(new FileWriter(name + ".out"));	
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(239);
		}
	}

	public static void main(String[] args) {
		(new Thread(new number_ft("number"))).start();
	}
}
