// Arup Guha
// 7/13/2026
// Solution to 1994 UCF HSPT Problem: Back Seat Driver

import java.util.*;

public class driver {
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		
		/*** Note: The posted C solution doesn't do what the specification says. The
		           posted C solution places a blank line after the output for every
				   case, including the last one. The specification is clear though to
				   "Print a blank line between output for different data sets."
				   So I am just going to keep this in my posted solution. Also,
				   I have posted the output data based on my solution and not their
				   posted solution.
		***/
		
		// This is annoying.
		boolean printBlank = false;
		
		// Process cases.
		while (stdin.hasNext()) {
		
			// To make between cases.
			if (printBlank) System.out.println();

			// Get the input case.
			int n = Integer.parseInt(stdin.nextLine());
			String line = stdin.nextLine();
				
			// Store all output here.
			String[] out = new String[n];
			for (int i=0; i<n; i++) out[i] = "";
			
			// Index into the string and speaker number.
			int idx = 0, turn = 0;
			
			// Go to end.
			while (idx < line.length()) {
			
				// Get the ending index of this speaker, exclusive.
				int endIdx = getEndIdx(line, idx);
				
				// Update their speech.
				out[turn] = out[turn] + fix(line.substring(idx, endIdx));
				
				// Update speaker.
				turn = (turn + 1)%n;
				
				// Skip delimiter.
				idx = endIdx+1;
			}
			
			// Print each person.
			for (int i=0; i<n; i++) {
				System.out.print("Person #"+(i+1)+":  ");
				System.out.println(out[i]);
			}
			
			// Returns index of loudest speaker.
			int best = getBest(out);
			System.out.println("Follow person #"+(best+1)+":  "+out[best]);
			
			// Now we do this.
			printBlank = true;
		}
	}
	
	// Returns the end index exclusive of the speaker starting at index idx in line.
	public static int getEndIdx(String line, int idx) {
	
		while (idx < line.length()) {
		
			// Skip over all non exclamation points.
			if (line.charAt(idx) != '!') {
				idx++;
				continue;
			}
			
			// Also skip over 2 of these in a row.
			if (idx+1<line.length() && line.charAt(idx+1) == '!')
				idx += 2;
				
			else
				return idx;
		}
		
		// Just the end of the string here.
		return line.length();
	}
	
	// Replaces each occurrence of !! in s with !
	public static String fix(String s) {
	
		String res = "";
		int idx = 0;
		while (idx < s.length()) {
			
			// Regular case.
			if (s.charAt(idx) != '!') 
				res += s.charAt(idx++);
			
			// Two ! is just worth 1.
			else {
				res += s.charAt(idx);
				idx += 2;
			}
		}
		
		return res;
	}
	
	// Returns the number of occurrences of ch in s.
	public static int count(String s, char ch) {
		int res = 0;
		for (int i=0; i<s.length(); i++)
			if (s.charAt(i) == ch)
				res++;
		return res;
	}
	
	public static int getBest(String[] out) {
		
		// Initial answer.
		int best = 0;
		int bestCount = count(out[0], '!');
		
		// Check rest.
		for (int i=1; i<out.length; i++) {
			
			// Here's this one.
			int newCnt = count(out[i], '!');
			
			// It's better so update. (Specification is ambigious, but I am doing this.)
			if (newCnt > bestCount) {
				best = i;
				bestCount = newCnt;
			}
		}
		
		// Ta da!
		return best;
	}
}