// Arup Guha
// 2/18/2024
// Solution to Kattis Problem: Set
// https://open.kattis.com/problems/set

import java.util.*;

public class set {

	public static String[] cards;

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		cards = new String[12];
		
		// Get cards.
		for (int i=0; i<12; i++)
			cards[i] = stdin.next();
		
		boolean printed = false;
			
		// Brute force all triplets of cards.
		for (int i=0; i<12; i++)
			for (int j=i+1; j<12; j++)
				for (int k=j+1; k<12; k++)
					if (match(i,j,k)) {
						System.out.println((i+1)+" "+(j+1)+" "+(k+1));
						printed = true;
					}
					
		// This is dumb.
		if (!printed) System.out.println("no sets");
	}
	
	public static boolean match(int c1, int c2, int c3) {
	
		// Go to each character.
		for (int i=0; i<cards[0].length(); i++) {
		
			// Check if all same or different, if so, continue.
			if (same(c1,c2,c3,i)) continue;
			if (diff(c1,c2,c3,i)) continue;
			
			// If we get here, it's not a set.
			return false;
		}
		
		// If we get here, it is a set!
		return true;
	}
	
	
	// Returns truee iff cards c1, c2 and c3 are all the same at index idx.
	public static boolean same(int c1, int c2, int c3, int idx) {
		return cards[c1].charAt(idx) == cards[c2].charAt(idx) && 
		       cards[c1].charAt(idx) == cards[c3].charAt(idx);
	}
	
	// Returns true iff cards c1, c2 and c3 are all different at index idx.
	public static boolean diff(int c1, int c2, int c3, int idx) {
		if (cards[c1].charAt(idx) == cards[c2].charAt(idx)) return false;
		if (cards[c1].charAt(idx) == cards[c3].charAt(idx)) return false;
		if (cards[c2].charAt(idx) == cards[c3].charAt(idx)) return false;
		return true;
	}
}