#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n;
char s1[N], s2[N];
int father[30];
int get(int first) {
  if (father[first] == first) {
    return first;
  }
  return get(father[first]);
}
bool same(int u, int v) { return get(u) == get(v); }
void merge(int first, int second) {
  first = get(first);
  second = get(second);
  if (first != second) {
    father[second] = first;
  }
}
int otp[N][2];
int main() {
  cin >> n;
  cin >> s1 >> s2;
  for (int i = (0), i_end_ = (30); i < i_end_; ++i) father[i] = i;
  int cnt = 0;
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) {
    if (!same(s1[i] - 'a', s2[i] - 'a')) {
      otp[cnt][0] = s1[i], otp[cnt++][1] = s2[i];
      merge(s1[i] - 'a', s2[i] - 'a');
    }
  }
  cout << cnt << endl;
  for (int i = (0), i_end_ = (cnt); i < i_end_; ++i)
    cout << (char)otp[i][0] << " " << (char)otp[i][1] << endl;
  return 0;
}
