#include <bits/stdc++.h>
using namespace std;
void dfs(long long id, bool *vis, set<long long> *g,
         vector<pair<char, char>> &answer) {
  vis[id] = true;
  for (auto it : g[id]) {
    if (!vis[it]) {
      answer.push_back({'a' + id, 'a' + it});
      dfs(it, vis, g, answer);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, i;
  cin >> n;
  string a, b;
  cin >> a >> b;
  set<long long> g[26];
  for (i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      g[a[i] - 'a'].insert(b[i] - 'a');
      g[b[i] - 'a'].insert(a[i] - 'a');
    }
  }
  bool vis[26] = {false};
  long long ans = 26;
  vector<pair<char, char>> answer;
  for (i = 0; i < 26; i++) {
    if (!vis[i]) {
      dfs(i, vis, g, answer);
      ans--;
    }
  }
  cout << ans << '\n';
  for (auto it : answer) {
    cout << it.first << ' ' << it.second << '\n';
  }
  return 0;
}
