#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<pair<char, char>> ans;
map<char, vector<char>> adj;
map<char, bool> vis;
void dfs(char node) {
  if (vis[node]) return;
  vis[node] = 1;
  for (int i = 0; i < adj[node].size(); i++) {
    char child = adj[node][i];
    if (!vis[child]) {
      ans.push_back({node, child});
      dfs(child);
    }
  }
}
int main() {
  int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    if (s1[i] != s2[i]) {
      adj[s1[i]].push_back(s2[i]);
      adj[s2[i]].push_back(s1[i]);
    }
  }
  for (char i = 'a'; i <= 'z'; i++) dfs(i);
  cout << ans.size() << endl;
  for (auto i : ans) cout << i.first << " " << i.second << endl;
  return 0;
}
