using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
var n1 = int.Parse(Console.ReadLine());
//
for(int a =1; a<=9; a++)
for(int b =1; b<=9; b++)
for(int c =1; c<=9; c++)
for(int d =1; d<=9; d++)
if(n1 % a ==0 && n1 % b ==0 && n1 % c == 0 && n1 % d == 0)
Console.Write("{0}{1}{2}{3} ", a,b,c,d);
}