#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int tree[26];
vector<pair<char, char>> edges;
string s1, s2;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> s1 >> s2;
  for (int i = 0; i < 26; i++) tree[i] = i;
  for (int i = 0; i < n; i++) {
    a = tree[s1[i] - 'a'];
    b = tree[s2[i] - 'a'];
    if (a == b) continue;
    tree[s1[i] - 'a'] = tree[s2[i] - 'a'];
    for (int i = 0; i < 26; i++) {
      if (tree[i] == a) tree[i] = b;
    }
    edges.push_back(make_pair(s1[i], s2[i]));
  }
  cout << edges.size() << "\n";
  for (int i = 0; i < edges.size(); i++) {
    cout << edges[i].first << " " << edges[i].second << "\n";
  }
  return 0;
}
