#include <bits/stdc++.h>
using namespace std;
const long long maxN = 5e3 + 2, Mod = 1e9 + 7;
long long n, ans;
string s, e;
int Dad[30], H[30];
vector<pair<char, char> > Ans;
int root(int x) {
  if (Dad[x] == x) return x;
  Dad[x] = root(Dad[x]);
  return Dad[x];
}
void merge(int x, int y) {
  if (H[y] < H[x]) swap(x, y);
  Dad[x] = y;
}
int main() {
  cin >> n >> s >> e;
  for (int i = 0; i < 30; i++) Dad[i] = i;
  for (long long i = 0; i < n; i++) {
    if (root(s[i] - 'a') == root(e[i] - 'a')) continue;
    Ans.push_back(make_pair(s[i], e[i]));
    merge(root(s[i] - 'a'), root(e[i] - 'a'));
    ans++;
  }
  cout << ans << endl;
  for (int i = 0; i < ans; i++)
    cout << Ans[i].first << " " << Ans[i].second << endl;
  return 0;
}
