#include <stdio.h>

#define N 300000
#define INC(X) \
  ( (X) % 7 == 1 ? (X) + 5 : (X) + 2 )

static int p[ N ];
static int pn;

/** Application main entry point. */
int
main (
  int     argc,
  char  * argv[ ]
  )
{
  int i, j;

  for ( i = 6; i < N; i = INC( i ) )
  {
    if ( p[ i ] ) continue ;

    for ( j = 6; i * j < N; j = INC( j ) )
    {
      p[ i * j ] = 1;
    }
  }
  for ( i = 6; i < N; i = INC( i ) )
  {
    if ( p[ i ] ) continue ;

    p[ pn++ ] = i;
  }

  for ( ; ; )
  {
    int n;

    scanf ( "%d", &n );
    if ( n == 1 ) break ;

    printf ( "%d:", n );
    for ( i = 0; i < pn; ++i )
    {
      if ( n % p[ i ] ) continue ;

      printf ( " %d", p[ i ] );
    }
    puts ( "" );
  }

  return ( 0 );
}