#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> adj(30);
int r;
int vis[100005];
int cnt;
bool f = 0;
void dfs(int n) {
  vis[n] = cnt;
  if (n == r) f = 1;
  for (int i = 0; i < adj[n].size(); i++) {
    if (vis[adj[n][i]] != cnt) dfs(adj[n][i]);
  }
}
int main() {
  int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  vector<pair<char, char>> v;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] != s2[i]) {
      r = (int)(s1[i] - 'a');
      int q = (int)(s2[i] - 'a');
      cnt++;
      f = 0;
      dfs(q);
      if (!f) {
        v.push_back(make_pair(s1[i], s2[i]));
        adj[r].push_back(q);
        adj[q].push_back(r);
      }
    }
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << endl;
  return 0;
}
