#include <bits/stdc++.h>
using namespace std;
string s, ss;
long long sz, par[30], ans;
vector<pair<char, char> > p;
long long fp(long long x) {
  if (par[x] == x) return x;
  return par[x] = fp(par[x]);
}
int main() {
  scanf("%lld", &sz);
  cin >> s >> ss;
  for (int i = 0; i <= 27; i++) par[i] = i;
  for (int i = 0; i < sz; i++) {
    long long pa = fp(s[i] - 'a');
    long long pb = fp(ss[i] - 'a');
    if (pa != pb) {
      ans++;
      par[pa] = pb;
      p.push_back(make_pair(s[i], ss[i]));
    }
  }
  sz = p.size();
  printf("%lld\n", sz);
  for (int i = 0; i < sz; i++) printf("%c %c\n", p[i].first, p[i].second);
  return 0;
}
