#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  cin >> n;
  int c[26], size[26];
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < 26; i++) {
    c[i] = -1;
    size[i] = 1;
  }
  vector<pair<char, char>> v;
  for (int i = 0; i < n; i++) {
    int a1 = s[i] - 'a', b1 = t[i] - 'a', a, b;
    a = a1, b = b1;
    while (c[a] != -1) {
      a = c[a];
    }
    while (c[b] != -1) {
      b = c[b];
    }
    if (a != b) {
      if (size[a] > size[b]) {
        size[a] += size[b];
        c[b] = a;
      } else {
        size[b] += size[a];
        c[a] = b;
      }
      ans += 1;
      v.push_back({a1 + 'a', b1 + 'a'});
    }
  }
  cout << ans << endl;
  for (int i = 0; i < ans; i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
}
