#include <bits/stdc++.h>
using namespace std;
const long long maxn = 200005;
long long n, m, p[30], a, b, cnt;
char X[maxn], Y[maxn];
string str1, str2;
int finds(int x) {
  if (p[x] != x) p[x] = finds(p[x]);
  return p[x];
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> str1 >> str2;
  for (int i = 1; i <= 26; i++) p[i] = i;
  for (int i = 0; i < n; i++) {
    if (str1[i] != str2[i]) {
      a = finds(str1[i] - 'a' + 1), b = finds(str2[i] - 'a' + 1);
      if (a != b) {
        p[a] = b;
        X[cnt] = str1[i];
        Y[cnt++] = str2[i];
      }
    }
  }
  cout << cnt << endl;
  for (int i = 0; i < cnt; i++) cout << X[i] << " " << Y[i] << endl;
  return 0;
}
