#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, adj[26][26];
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < 26; j++) {
      if (i == j)
        adj[i][j] = 1;
      else
        adj[i][j] = 1e9;
    }
  string s1, s2;
  vector<pair<char, char> > ans;
  cin >> N >> s1 >> s2;
  for (int i = 0; i < N; i++) {
    int a = s1[i] - 97, b = s2[i] - 97;
    if (adj[a][b] == 1e9 && adj[b][a] == 1e9) {
      adj[a][b] = adj[b][a] = 1;
      for (int k = 0; k < 26; k++)
        for (int i = 0; i < 26; i++)
          for (int j = 0; j < 26; j++)
            adj[i][j] = min(adj[i][j], adj[i][k] + adj[k][j]);
      ans.push_back(make_pair(s1[i], s2[i]));
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << "\n";
  return 0;
}
