#include <bits/stdc++.h>
using namespace std;
bool was[26];
vector<pair<char, char> > ans;
vector<int> a[26];
void go(int x) {
  was[x] = true;
  for (int i = 0; i < a[x].size(); i++) {
    if (!was[a[x][i]]) {
      go(a[x][i]);
      ans.push_back(make_pair((char)(x + 97), (char)(a[x][i] + 97)));
    }
  }
}
int main() {
  int n;
  string s1, s2;
  cin >> n;
  cin >> s1;
  cin >> s2;
  for (int i = 0; i < n; i++) {
    a[s1[i] - 'a'].push_back(s2[i] - 'a');
    a[s2[i] - 'a'].push_back(s1[i] - 'a');
  }
  for (int i = 0; i < 26; i++) {
    if (!was[i]) go(i);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
