class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
int T;
T=sc.nextInt();
for(int test_case = 1; test_case <= T; test_case++)
{
String str = Integer.toString(test_case);
int count = 0;
int n = 0;
int temp = test_case;
for(int i = 0; i < str.length(); i++){
n = temp % 10;
temp /= 10;
if(n == 3 || n == 6 || n == 9)
count++;
}
if(count == 0)
System.out.print(test_case);
else{
while(count >0){
System.out.print("-");
count -- ;
}
}
System.out.print(" ");
}
}
}```