#include <bits/stdc++.h>
using namespace std;
vector<int> g[30];
int vis[30] = {0};
vector<int> dis;
int deg[30] = {0};
void dfs(int i) {
  vis[i] = 1;
  for (int j = 0; j < g[i].size(); ++j) {
    if (!vis[g[i][j]]) {
      dfs(g[i][j]);
    }
  }
}
void dfs2(int i) {
  vis[i] = 1;
  for (int j = 0; j < g[i].size(); ++j) {
    if (!vis[g[i][j]]) {
      char a = i + 'a' - 1;
      char b = g[i][j] + 'a' - 1;
      cout << a << " " << b << "\n";
      dfs2(g[i][j]);
    }
  }
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string p;
  cin >> p;
  int c = 0;
  for (int i = 0; i < n; ++i) {
    dis.clear();
    memset(vis, 0, sizeof vis);
    if (s[i] != p[i]) {
      dfs(s[i] - 'a' + 1);
      if (vis[p[i] - 'a' + 1]) {
        continue;
      } else {
        g[p[i] - 'a' + 1].push_back(s[i] - 'a' + 1);
        g[s[i] - 'a' + 1].push_back(p[i] - 'a' + 1);
        ++c;
        deg[p[i] - 'a' + 1]++;
        deg[s[i] - 'a' + 1]++;
      }
    }
  }
  cout << c << "\n";
  memset(vis, 0, sizeof vis);
  for (int i = 1; i <= 26; ++i) {
    if (g[i].size() == 0) {
      continue;
    }
    if (!vis[i]) {
      dfs2(i);
    }
  }
}
