factors = {} words = {} // get the max number print ">" max = int(input()) // get the factors inp = " " while inp != "" print ">" inp = input() if " " in inp factors.append(int(split(inp, " ")[0])) words.append(split(inp, " ")[1]) end end // output all the numbers for i in range(1, max) foundfactor = false for j in range(0, len(factors) - 1) if (i % factors[j]) = 0 foundfactor = true print words[j] end end j = 0 if !foundfactor print i end println end