15
MIRZOYANOVECLOX
 23
AABBBAAACCCCCAAADDDDDDD
 2
QA
 11
GGRRAATTZZZ
 6
AZAZAZ
 10
SQSQSQSQTG
 3
KEK
 100
URXCAIZFIBNJTPCZHBQIBCILLPXZCFGMKKZMNPLCYGAVJVIBMCZEBSJWPSCPQDYCTTKPOKIJRSKIZPDGCHVOUTMPNECYORSFZFNC
 3
LOL
 2
WW
 8
PUTINVOR
 26
QWERTYUIOPASDFGHJKLZXCVBNM
 5
AZAZA
 9
EGORLETOV
 7
KADUROV
 9
MIKEPIDOR
 9
AAAAAAAAA
 100
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 5
FUFEL
 50
NYQAHBYYOXLTRYQDMVENEMAQNBAKGLGQOLXNAIFNQTOCLNNQIA

MI
 DD
 QA
 ZZ
 AZ
 SQ
 KE
 IB
 LO
 WW
 PU
 QW
 AZ
 EG
 KA
 MI
 AA
 AA
 FU
 YQ


import java.util.Scanner;

public class Twogram {

static int lps[];
	public static void main(String[] args) {
		Scanner y=new Scanner(System.in);
		int c=y.nextInt();
		String pat=y.next();
		
		computeLPSArray(pat);
		for(int i=0;i<lps.length;i++) {
			if(lps[i]==2) {
			System.out.println(pat.charAt(i)+""+pat.charAt(i-1));
			
			}
		}
		// TODO Auto-generated method stub

 	}

  
  public static void computeLPSArray(String pat) 
   {  lps=new int[pat.length()];
       // length of the previous longest prefix suffix 
       int len = 0; 
       int i = 1; 
       lps[0] = 0; 
 
       // the loop calculates lps[i] for i = 1 to M-1 
       while (i < pat.length()) { 
           if (pat.charAt(i) == pat.charAt(len)) { 
               len++; 
               lps[i] = len; 
               i++; 
           } 
           else // (pat[i] != pat[len]) 
           { 
               // This is tricky. Consider the example. 
               // AAACAAAA and i = 7. The idea is similar 
               // to search step. 
               if (len != 0) { 
                   len = lps[len - 1]; 
 
                   // Also, note that we do not increment 
                   // i here 
               } 
               else // if (len == 0) 
               { 
                   lps[i] = len; 
                   i++; 
               } 
           } 
       } 
   }}
