using System; public class Hello { static void Main() { var k = int.Parse(Console.ReadLine().Trim()); getAns(k); } static string make(string t) { var res = ""; foreach (var x in t) { if (x == '1') continue; else if (x == '2') res += res; else res += x; } return res; } static void getAns(int k) { var q = new Queue(); var a = new List(); q.Enqueue(""); while (q.Count > 0) { var w = q.Dequeue(); var n = w.Length; if (n == 8) a.Add(w); else if (n == 0) { q.Enqueue(w + "N1"); q.Enqueue(w + "N2"); } else if (n == 2) { q.Enqueue(w + "U1"); q.Enqueue(w + "U2"); } else if (n == 4) { q.Enqueue(w + "P1"); q.Enqueue(w + "P2"); } else if (n == 6) { q.Enqueue(w + "C1"); q.Enqueue(w + "C2"); } } var b = new List(); foreach (var x in a) b.Add(make(x)); b.Sort(); Console.WriteLine(b[k - 1]); } }