#include <bits/stdc++.h>
using namespace std;
int dsu[26];
int root(int pos) {
  while (dsu[pos] != pos) {
    pos = dsu[pos];
  }
  return pos;
}
int main() {
  int n;
  cin >> n;
  string a, b;
  cin >> a;
  cin >> b;
  vector<pair<char, char>> v;
  for (int i = 0; i < 26; i++) dsu[i] = i;
  for (int i = 0; i < n; i++) {
    if (root(a[i] - 'a') != root(b[i] - 'a')) {
      v.emplace_back(make_pair(a[i], b[i]));
      dsu[root(a[i] - 'a')] = root(b[i] - 'a');
    }
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
  return 0;
}
