#include <bits/stdc++.h>
using namespace std;
int a[100001];
int fnd(int x) {
  while (x != a[x]) {
    a[x] = a[a[x]];
    x = a[x];
  }
  return x;
}
int main() {
  int n, m;
  cin >> n;
  for (int i = 1; i <= 27; i++) a[i] = i;
  vector<pair<char, char> > k;
  string s1, s2;
  cin >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    int n1 = s1[i] - 'a';
    int n2 = s2[i] - 'a';
    int root_x = fnd(n1);
    int root_y = fnd(n2);
    if (root_x != root_y) {
      k.push_back(pair<char, char>(s1[i], s2[i]));
      a[root_x] = root_y;
    }
  }
  cout << k.size() << endl;
  for (int i = 0; i < k.size(); i++)
    cout << k[i].first << " " << k[i].second << endl;
  return 0;
}
