#include <bits/stdc++.h>
using namespace std;
unordered_map<char, unordered_set<char>> m;
bool vis[27];
int res = 0;
vector<pair<char, char>> v;
void bfs(char c) {
  vis[c - 'a'] = 1;
  for (unordered_set<char>::iterator it = m[c].begin(); it != m[c].end();
       it++) {
    if (!vis[*it - 'a']) {
      res++;
      v.push_back(make_pair(c, *it));
      bfs(*it);
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  ;
  string s;
  string t;
  cin >> s >> t;
  for (int i = 0; i < n; ++i) {
    if (s[i] != t[i]) {
      m[s[i]].insert(t[i]);
      m[t[i]].insert(s[i]);
    }
  }
  for (int i = 0; i < 26; ++i) {
    if (!vis[i]) {
      bfs('a' + i);
    }
  }
  cout << res << endl;
  for (int i = 0; i < v.size(); ++i) {
    cout << v[i].first << " " << v[i].second << endl;
  }
  return 0;
}
