#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
long long n;
const long long maxn = 1e5 + 100;
struct subset {
  long long parent;
  long long rank;
};
vector<subset> second(maxn);
long long Find(long long x) {
  if (second[x].parent == x) {
    return second[x].parent;
  }
  return Find(second[x].parent);
}
void Union(long long a, long long b) {
  long long x = Find(a);
  long long y = Find(b);
  if (second[x].rank < second[y].rank) {
    second[x].parent = y;
  } else if (second[y].rank < second[x].rank) {
    second[y].parent = x;
  } else {
    second[x].parent = y;
    second[y].rank++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  for (long long i = 0; i < maxn; i++) {
    second[i].parent = i;
    second[i].rank = 0;
  }
  cin >> n;
  string str1, str2;
  cin >> str1 >> str2;
  vector<pair<long long, long long> > ans;
  for (long long i = 0; i < n; i++) {
    long long pos1 = str1[i] - 'a';
    long long pos2 = str2[i] - 'a';
    if (Find(pos1) == Find(pos2)) {
      continue;
    }
    ans.push_back(make_pair(pos1, pos2));
    Union(pos1, pos2);
  }
  cout << ans.size() << '\n';
  for (auto i : ans) {
    cout << char(i.first + 'a') << ' ' << char(i.second + 'a') << '\n';
  }
  return 0;
}
