#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n;
char a[N], b[N];
int f[26];
int tot, last[N];
int ansx[N], ansy[N];
int find(int x) {
  if (x == f[x]) return x;
  return f[x] = find(f[x]);
}
int main() {
  scanf("%d", &n);
  scanf("%s%s", a + 1, b + 1);
  for (int i = 0; i < 26; i++) {
    f[i] = i;
    last[i] = i;
  }
  for (int i = 1; i <= n; i++) {
    int x = a[i] - 'a', y = b[i] - 'a';
    if (find(x) != find(y)) f[find(x)] = find(y);
  }
  for (int i = 0; i < 26; i++)
    if (find(i) != i) {
      ansx[++tot] = i;
      ansy[tot] = last[find(i)];
      last[find(i)] = i;
    }
  printf("%d\n", tot);
  for (int i = 1; i <= tot; i++)
    printf("%c %c\n", ansx[i] + 'a', ansy[i] + 'a');
  return 0;
}
