#include <bits/stdc++.h>
using namespace std;
vector<int> parent(26);
int find(int a) {
  while (parent[a] != a) a = parent[a];
  return a;
}
int onion(int a, int b) { parent[find(a)] = find(b); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  iota(parent.begin(), parent.end(), 0);
  int n;
  string s1, s2;
  cin >> n >> s1 >> s2;
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (find(s1[i] - 'a') != find(s2[i] - 'a')) {
      onion(s1[i] - 'a', s2[i] - 'a');
      ans++;
    }
  cout << ans << "\n";
  for (int i = 0; i < 26; i++)
    if (parent[i] != i)
      cout << (char)(i + 'a') << " " << (char)(parent[i] + 'a') << "\n";
}
