#include <bits/stdc++.h>
using namespace std;
int par[101];
int rank1[101];
int ans = 0;
string s;
int find1(int c) {
  if (c == par[c])
    return c;
  else
    return par[c] = find1(par[c]);
}
void merge1(int a, int b) {
  a = find1(a);
  b = find1(b);
  if (a == b) return;
  ans++;
  s += a + 97;
  s += b + 97;
  if (rank1[a] > rank1[b]) {
    par[b] = a;
    rank1[a] += rank1[b];
  } else {
    par[a] = b;
    rank1[b] += rank1[a];
  }
}
void solve() {
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  memset(par, -1, sizeof(par));
  for (int i = 0; i < n; i++) {
    if (par[a[i] - 97] == -1) par[a[i] - 97] = a[i] - 97, rank1[a[i] - 97] = 1;
    if (par[b[i] - 97] == -1) par[b[i] - 97] = b[i] - 97, rank1[b[i] - 97] = 1;
    merge1(a[i] - 97, b[i] - 97);
  }
  cout << ans << "\n";
  for (int i = 0; i < s.size(); i += 2) cout << s[i] << " " << s[i + 1] << "\n";
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  int t = 1;
  while (t--) solve(), cout << "\n";
}
