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