#include <bits/stdc++.h>
using namespace std;
vector<int> G[26];
bool vis[26];
vector<string> ans;
void rec(int indx) {
  vis[indx] = true;
  for (int i : G[indx]) {
    if (vis[i] == false) {
      vis[i] = true;
      char ch = (char)'a' + indx;
      ans.push_back(string(1, ch) + " " + string(1, i + 'a'));
      rec(i);
    }
  }
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string s1;
  cin >> s1;
  for (int i = 0; i < n; i++) {
    if (s[i] != s1[i]) {
      G[s[i] - 'a'].push_back(s1[i] - 'a');
      G[s1[i] - 'a'].push_back(s[i] - 'a');
    }
  }
  for (int i = 0; i < 26; i++) {
    if (vis[i] == false) {
      rec(i);
    }
  }
  cout << ans.size() << endl;
  for (auto x : ans) {
    cout << x << endl;
  }
}
