#include <bits/stdc++.h>
using namespace std;
const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const long long int Inf = 1LL << 62;
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
int dy8[] = {1, 0, -1, 1, -1, 1, 0, -1};
long long int vist[27];
vector<long long int> vec[27];
long long int flg;
long long int ch;
void dfs(long long int cur) {
  if (cur == ch) {
    flg = 1;
    return;
  }
  vist[cur] = 1;
  for (auto it : vec[cur]) {
    if (!vist[it]) {
      dfs(it);
    }
  }
}
char ans[2222][2];
int main() {
  long long int n, m, k, q, t, cnt = 0, sum = 0, mx = -Inf, mn = Inf;
  scanf("%lld", &n);
  string s1, s2;
  cin >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    if (s1[i] != s2[i]) {
      flg = 0;
      ch = s2[i] - 'a';
      memset(vist, 0, sizeof(vist));
      dfs(s1[i] - 'a');
      if (flg) {
        continue;
      }
      ch = s1[i] - 'a';
      flg = 0;
      memset(vist, 0, sizeof(vist));
      dfs(s2[i] - 'a');
      if (flg) {
        continue;
      }
      vec[s1[i] - 'a'].push_back(s2[i] - 'a');
      vec[s2[i] - 'a'].push_back(s1[i] - 'a');
      cnt++;
      ans[cnt][0] = s1[i];
      ans[cnt][1] = s2[i];
    }
  }
  cout << (cnt) << endl;
  for (int i = 1; i <= cnt; i++) {
    printf("%c %c\n", ans[i][0], ans[i][1]);
  }
  return 0;
}
