#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int n, i, j, r, s, k = 0;
list<int> *adjusted = new list<int>[26];
pair<char, char> res[100005];
bool solve(int s, int d) {
  if (s == d) return true;
  bool used[26];
  memset(used, 0, sizeof(used));
  list<int> q;
  used[s] = true;
  q.push_back(s);
  list<int>::iterator i;
  while (!q.empty()) {
    s = q.front();
    q.pop_front();
    for (i = adjusted[s].begin(); i != adjusted[s].end(); ++i) {
      if (*i == d) return true;
      if (!used[*i]) {
        used[*i] = true;
        q.push_back(*i);
      }
    }
  }
  return false;
}
int main() {
  cin >> n;
  string str, ch;
  cin >> str;
  cin >> ch;
  for (i = 0; i < n; i++) {
    if (str[i] != ch[i]) {
      r = str[i] - 'a';
      s = ch[i] - 'a';
      if (!solve(r, s)) {
        res[k].first = str[i];
        res[k].second = ch[i];
        k++;
        adjusted[str[i] - 'a'].push_back(ch[i] - 'a');
        adjusted[ch[i] - 'a'].push_back(str[i] - 'a');
      }
    }
  }
  cout << k << "\n";
  for (i = 0; i < k; i++) {
    cout << res[i].first << ' ' << res[i].second << "\n";
  }
  return 0;
}
