#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int N = 200005;
int len, fa[26], sz[N];
char s1[N], s2[N];
int Find(int x) { return (fa[x] == x) ? x : fa[x] = Find(fa[x]); }
void Unite(int x, int y) {
  int fax = Find(x), fay = Find(y);
  if (fax != fay) fa[fax] = fay, sz[fay] += sz[fax];
}
vector<int> ans[26];
int main() {
  for (int i = 0; i <= 25; ++i) fa[i] = i, sz[i] = 1;
  scanf("%d", &len);
  scanf("%s%s", s1 + 1, s2 + 1);
  for (int i = 1; i <= len; ++i) {
    if (s1[i] == s2[i]) continue;
    if (s1[i] > s2[i]) swap(s1[i], s2[i]);
    Unite(s1[i] - 'a', s2[i] - 'a');
  }
  int ans1 = 0;
  for (int i = 0; i <= 25; ++i)
    if (fa[i] != i) ans[fa[i]].push_back(i), ++ans1;
  printf("%d\n", ans1);
  for (int i = 0; i <= 25; ++i)
    if (ans[i].size() > 0)
      for (int u : ans[i]) printf("%c %c\n", 'a' + u, 'a' + i);
  return 0;
}
