#include <bits/stdc++.h>
using namespace std;
vector<int> v[27];
bool vis[27];
vector<pair<int, int> > pr;
int cnt, flag;
void dfs(int nod, int dest) {
  int i;
  vis[nod] = 1;
  if (nod == dest) {
    flag = 1;
    return;
  }
  for (i = 0; i < v[nod].size(); i++) {
    int curr = v[nod][i];
    if (vis[curr] == 0) {
      dfs(curr, dest);
    }
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, i;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  for (i = 0; i < n; i++) {
    flag = 0;
    memset(vis, 0, sizeof(vis));
    int nod = s1[i] - 'a' + 1;
    int dest = s2[i] - 'a' + 1;
    dfs(nod, dest);
    if (flag == 0) {
      cnt++;
      pr.push_back(make_pair(nod, dest));
      v[nod].push_back(dest);
      v[dest].push_back(nod);
    }
  }
  cout << cnt << endl;
  for (i = 0; i < pr.size(); i++) {
    char ch1 = pr[i].first + 'a' - 1, ch2 = pr[i].second + 'a' - 1;
    cout << ch1 << " " << ch2 << endl;
  }
  return 0;
}
