#include <bits/stdc++.h>
using namespace std;
int L[300005];
int cnt[300005];
int Find(int x) { return x == L[x] ? x : L[x] = Find(L[x]); }
void Union(int x, int y) { L[Find(x)] = Find(y); }
int main() {
  int i, j, n;
  string s, t;
  scanf("%d", &n);
  cin >> s >> t;
  ;
  for (int i = 0; i < 26; i++) {
    L[i] = i;
    cnt[i] = 1;
  }
  for (i = 0; i < n; i++) {
    if (s[i] == t[i]) continue;
    Union(s[i] - 'a', t[i] - 'a');
  }
  map<char, char> mp;
  for (i = 0; i < n; i++) {
    if (s[i] != Find(s[i] - 'a') + 'a') mp[s[i]] = Find(s[i] - 'a') + 'a';
    if (t[i] != Find(t[i] - 'a') + 'a') mp[t[i]] = Find(t[i] - 'a') + 'a';
  }
  cout << mp.size() << endl;
  for (auto el : mp) printf("%c %c\n", el.first, el.second);
  return 0;
}
