#include <bits/stdc++.h>
using namespace std;
vector<int> par(30, -1);
int root(int v) {
  if (par[v] < 0) return v;
  return par[v] = root(par[v]);
}
void uni(int x, int y) {
  x = root(x);
  y = root(y);
  if (par[x] > par[y]) swap(x, y);
  par[x] += par[y];
  par[y] = x;
}
int main() {
  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  string v, t;
  cin >> v >> t;
  vector<pair<char, char> > ans;
  for (int i = 0; i < n; i++) {
    if (root(v[i] - 'a') != root(t[i] - 'a')) {
      uni(v[i] - 'a', t[i] - 'a');
      ans.push_back(make_pair(v[i], t[i]));
    }
  }
  cout << ans.size() << endl;
  cerr << "ans.size()"
       << ":" << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
