#include <bits/stdc++.h>
using namespace std;

char s[11];

int cmp(char *a, char *b) {
	int x = 0, y = 0;
	for (int i=0; i<5; ++i) {
		if (a[i] == b[i]) { ++x; continue; }
		for (int j=0; j<5; ++j) if (a[i] == b[j]) { ++y; break; }
	}
	return 10 * x + y;
}


char match[8];

int main() {
	sprintf(s, "0123456789");
	do {
		reverse(s+5, s+10);
		
		int cnt = 0;
		match[0] = (cmp(s, "76070") ==  2 ? '1' : '0'); if (match[0] == '1') ++cnt;
		match[1] = (cmp(s, "24112") == 10 ? '1' : '0'); if (match[1] == '1') ++cnt;
		match[2] = (cmp(s, "93535") == 11 ? '1' : '0'); if (match[2] == '1') ++cnt;
		match[3] = (cmp(s, "67253") ==  2 ? '1' : '0'); if (match[3] == '1') ++cnt;
		match[4] = (cmp(s, "01497") == 12 ? '1' : '0'); if (match[4] == '1') ++cnt;
		match[5] = (cmp(s, "94501") == 12 ? '1' : '0'); if (match[5] == '1') ++cnt;
		match[6] = (cmp(s, "25349") ==  3 ? '1' : '0'); if (match[6] == '1') ++cnt;
		
		if (cnt >= 6) printf("%c%c%c%c%c: %s\n", s[0], s[1], s[2], s[3], s[4], match);
		
	} while (next_permutation(s, s+10));
	return 0;
}