import java.io.*; import java.util.*; public class Main_yukicoder543 { private static Scanner sc; private static Printer pr; private static void solve() { char[] a = sc.next().toCharArray(); char[] b = sc.next().toCharArray(); pr.printf("%c %c\n", b[0], a[0]); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }