#include <bits/stdc++.h>
using namespace std;
inline void up(int& x, int y) {
  x = x + y < 1000000007 ? x + y : x + y - 1000000007;
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int a[55][55], l, d, f[55], ans[88][2], an;
char b[100010], c[100010];
int getf(int q) {
  if (q == f[q]) return q;
  f[q] = getf(f[q]);
  return f[q];
}
int main() {
  cin >> l;
  scanf("%s%s", b, c);
  for (int i = 0; i < l; i++)
    a[b[i] - 'a'][c[i] - 'a'] = a[c[i] - 'a'][b[i] - 'a'] = 1;
  for (int i = 0; i < 26; i++) f[i] = i;
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++)
      if (a[i][j]) f[getf(i)] = getf(j);
  for (int i = 0; i < 26; i++)
    if (getf(i) != i) ans[++an][0] = i, ans[an][1] = getf(i);
  printf("%d\n", an);
  for (int i = 1; i <= an; i++)
    printf("%c %c\n", 'a' + ans[i][0], 'a' + ans[i][1]);
  return 0;
}
