#include <bits/stdc++.h>
using namespace std;
string s1, s2;
vector<pair<char, char> > ans;
int par[1005];
int findparent(int num) {
  if (par[num] == num) return num;
  return par[num] = findparent(par[num]);
}
int main() {
  int n;
  cin >> n >> s1 >> s2;
  for (int i = 0; i <= 300; i++) {
    par[i] = i;
  }
  for (int i = 0; i < n; i++) {
    int x = findparent(s1[i]);
    int y = findparent(s2[i]);
    if (x != y) {
      if (x > y) swap(x, y);
      par[y] = par[x];
      ans.push_back({s1[i], s2[i]});
    }
  }
  cout << (int)ans.size() << endl;
  for (auto x : ans) {
    cout << x.first << ' ' << x.second << endl;
  }
  return 0;
}
