#!/usr/bin/env python # -*- coding: utf-8 -*- # # die.py # # Copyright 2018 Contest team 084 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # kostky = [ [ ":::", ":o:", ":::" ], [ "o::", ":::", "::o" ], [ "o::", ":o:", "::o" ], [ "o:o", ":::", "o:o" ], [ "o:o", ":o:", "o:o" ], [ "o:o", "o:o", "o:o" ] ] def rotace(k): k2 = [[],[],[]] k2[0] = k[2][0] + k[1][0] + k[0][0] k2[1] = k[2][1] + k[1][1] + k[0][1] k2[2] = k[2][2] + k[1][2] + k[0][2] #k2[0][0] = k[2][0] #k2[0][1] = k[1][0] #k2[0][2] = k[0][0] #k2[1][0] = k[2][1] #k2[1][1] = k[1][1] #k2[1][2] = k[0][1] #k2[2][0] = k[2][2] #k2[2][1] = k[1][2] #k2[2][2] = k[0][2] return k2 def reader(): try: while True: yield input() except EOFError: raise StopIteration def tostr(v): t = "" for f in v: t += f return t def main(): v = list(reader()) #print(rotace(kostky[5])) #print(tostr(v) == tostr(kostky[3])) #v = reduce(lambda x, y: x + y, v) #print(v) #print(v, kostky[4], v is kostky[4]) i = 0 for k in kostky: i += 1 if tostr(v) == tostr(k) or tostr(v) == tostr(rotace(k)): print(i) break if i > 6: print("unknown") return 0 if __name__ == '__main__': main()