#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
using namespace std::chrono;
char dsu[27];
char parent(char u) {
  if (u != dsu[u - 'a']) dsu[u - 'a'] = parent(dsu[u - 'a']);
  return dsu[u - 'a'];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  for (int i = 0; i <= 26; i++) dsu[i] = i + 'a';
  long long int ctr = 0;
  vector<char> A, B;
  for (int i = 0; i < n; i++) {
    if (s1[i] != s2[i]) {
      char x = parent(s1[i]), y = parent(s2[i]);
      if (x != y) {
        dsu[x - 'a'] = y;
        ctr++;
        A.push_back(s1[i]);
        B.push_back(s2[i]);
      }
    }
  }
  cout << ctr << endl;
  for (int i = 0; i < A.size(); i++) cout << A[i] << " " << B[i] << endl;
  return 0;
}
