#include <bits/stdc++.h>
using namespace std;
const long long N = 100005;
string s, t;
long long par[26], a[N], b[N];
vector<pair<char, char> > ans;
long long get(long long x) {
  return ((x == par[x]) ? (x) : par[x] = get(par[x]));
}
void unite(long long v, long long u) {
  long long parv = get(v);
  long long paru = get(u);
  if (parv == paru) return;
  par[paru] = parv;
  return;
}
int main() {
  long long n, i;
  cin >> n >> s >> t;
  for (i = 0; i < n; i++) {
    a[i] = s[i] - 'a';
    b[i] = t[i] - 'a';
  }
  for (i = 0; i < 26; i++) par[i] = i;
  for (i = 0; i < n; i++) unite(a[i], b[i]);
  for (i = 0; i < 26; i++)
    if (par[i] != i) ans.push_back(make_pair((char)i, (char)par[i]));
  cout << ans.size() << "\n";
  for (auto &x : ans)
    cout << char(x.first + 'a') << " " << char(x.second + 'a') << "\n";
  return 0;
}
