#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
char s1[N], s2[N];
char read() {
  char ch = getchar();
  while (ch < 'a' || ch > 'z') ch = getchar();
  return ch;
}
int fa[255];
struct res {
  char a, b;
} ans[N];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
void un(int a, int b) {
  int f1 = find(a), f2 = find(b);
  fa[f1] = f2;
}
int main() {
  int cnt = 0, n;
  scanf("%d", &n);
  for (int i = 1; i <= 255; i++) fa[i] = i;
  for (int i = 1; i <= n; i++) s1[i] = read();
  for (int i = 1; i <= n; i++) s2[i] = read();
  for (int i = 1; i <= n; i++) {
    if (find(s1[i]) != find(s2[i])) {
      ans[++cnt].a = s1[i];
      ans[cnt].b = s2[i];
      un(s1[i], s2[i]);
    }
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) {
    printf("%c %c\n", ans[i].a, ans[i].b);
  }
  return 0;
}
