import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Stack; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int idx = 1; while (true) { String s = br.readLine(); if(s.startsWith("-")) break; System.out.printf("%d. %d\n",idx, solution(s..