#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000 * 1000 * 1000;
const long long LINF = (long long)INF * INF;
const long long mod = INF + 7;
const double EPS = 1e-5;
const long long MOD = 1000 * 1000 * 1000;
vector<pair<int, int> > vals;
int n;
string second, t;
vector<pair<int, int> > ans;
int main() {
  cin >> n >> second >> t;
  for (int i = 0; i < n; i++) {
    if (second[i] != t[i]) {
      vals.push_back({second[i] - 'a', t[i] - 'a'});
    }
  }
  while (!vals.empty()) {
    ans.push_back(vals[0]);
    int prev = vals[0].first, nxt = vals[0].second;
    vector<pair<int, int> > newVals;
    for (int i = 0; i < vals.size(); i++) {
      if (vals[i].first == prev) vals[i].first = nxt;
      if (vals[i].second == prev) vals[i].second = nxt;
      if (vals[i].first != vals[i].second)
        newVals.push_back({vals[i].first, vals[i].second});
    }
    vals = newVals;
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << (char)(ans[i].first + 'a') << " " << (char)(ans[i].second + 'a')
         << endl;
  return 0;
}
