#include <bits/stdc++.h>
using namespace std;
const int MX = 1147483646;
const long long MX2 = 9223372036854775800;
const int MOD = 1000000007;
int p[30];
int find(int n) {
  if (p[n] < 0) return n;
  return p[n] = find(p[n]);
}
void uni(int e1, int e2) {
  e1 = find(e1);
  e2 = find(e2);
  if (e1 == e2) return;
  p[e1] = e2;
  return;
}
int main() {
  int n;
  scanf("%d", &n);
  char s1[100011], s2[100011];
  vector<pair<int, int> > ans;
  fill(p, p + 30, -1);
  scanf("%s %s", s1, s2);
  int a1, a2;
  for (int i = 0; i < n; i++) {
    a1 = find(int(s1[i] - 'a'));
    a2 = find(int(s2[i] - 'a'));
    if (a1 != a2) {
      ans.push_back({a1, a2});
      uni(a1, a2);
    }
  }
  printf("%d\n", ans.size());
  for (pair<int, int> x : ans) {
    printf("%c %c\n", x.first + 'a', x.second + 'a');
  }
  return 0;
}
