#include <bits/stdc++.h>
using namespace std;
vector<int> v[10000];
int main() {
  vector<pair<int, int>> v;
  string s1, s2;
  int n;
  cin >> n >> s1 >> s2;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] != s2[i]) {
      v.push_back(make_pair(s1[i], s2[i]));
      char s = s2[i];
      for (int j = i; j < s1.size(); j++) {
        if (s1[j] == s) {
          s1[j] = s1[i];
        }
        if (s2[j] == s) {
          s2[j] = s1[i];
        }
      }
    }
  }
  cout << v.size() << endl;
  for (auto i : v) {
    cout << (char)i.first << " " << (char)i.second << endl;
  }
  return 0;
}
