#include <bits/stdc++.h>
using namespace std;
int N, ans;
string a, b;
int uf[100];
char op[200005][2];
int id(int x) {
  if (uf[x] == x) return x;
  return uf[x] = id(uf[x]);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N;
  cin >> a;
  cin >> b;
  for (int i = 0; i < 50; i++) uf[i] = i;
  for (int i = 0; i < N; i++)
    if (id(a[i] - 'a' + 1) != id(b[i] - 'a' + 1)) {
      ans++;
      op[ans][0] = a[i];
      op[ans][1] = b[i];
      uf[id(a[i] - 'a' + 1)] = uf[id(b[i] - 'a' + 1)];
    }
  cout << ans << "\n";
  for (int i = 1; i <= ans; i++) cout << op[i][0] << " " << op[i][1] << "\n";
  return 0;
}
