#include <bits/stdc++.h>
using namespace std;
long long int parent[26];
long long int find(long long int x) {
  if (x == parent[x]) return x;
  return parent[x] = find(parent[x]);
}
void merge(long long int x, long long int y) { parent[y] = x; }
signed main() {
  long long int n;
  cin >> n;
  for (long long int i = 0; i < 26; i++) parent[i] = i;
  string a, b;
  cin >> a >> b;
  vector<pair<char, char>> diff;
  for (long long int i = 0; i < n; i++) {
    long long int x = a[i] - 'a', y = b[i] - 'a';
    long long int u = find(x), v = find(y);
    if (u != v) {
      merge(u, v);
      diff.push_back(make_pair(a[i], b[i]));
    }
  }
  cout << diff.size() << endl;
  for (auto x : diff) cout << x.first << " " << x.second << endl;
}
