#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int k = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    k = k * 10 + ch - '0';
    ch = getchar();
  }
  return k * f;
}
inline void write(int x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(int x) {
  write(x);
  puts("");
}
const int N = 100005;
int f[30];
int n, ans;
char a[N], b[N];
vector<int> edge[30];
pair<char, char> path[30];
int getf(int x) {
  if (f[x] == x) return x;
  return f[x] = getf(f[x]);
}
int main() {
  n = read();
  scanf("%s", a + 1);
  scanf("%s", b + 1);
  for (int i = 1; i <= 26; ++i) f[i] = i;
  for (int i = 1; i <= n; ++i)
    if (a[i] != b[i]) {
      int fa = getf(a[i] - 'a'), fb = getf(b[i] - 'a');
      if (fa == fb) continue;
      f[fa] = fb;
    }
  for (int i = 0; i < 26; ++i) {
    int fa = getf(i);
    edge[fa].push_back(i);
  }
  for (int i = 0; i < 26; ++i) {
    for (int j = 1; j < edge[i].size(); ++j)
      path[++ans] = make_pair(edge[i][j - 1] + 'a', edge[i][j] + 'a');
  }
  writeln(ans);
  for (int i = 1; i <= ans; ++i)
    printf("%c %c\n", path[i].first, path[i].second);
  return 0;
}
