#include <bits/stdc++.h>
using namespace std;
const int md = 1e5 + 10;
struct node {
  int x, y;
  node(int _x = 0, int _y = 0) {
    x = _x;
    y = _y;
  }
};
vector<node> ans;
vector<int> adj[md];
bool vis[md];
string s, s1;
int n;
void dfs(int u) {
  vis[u] = true;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (!vis[v]) {
      ans.push_back(node(u, v));
      dfs(v);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  cin >> s;
  cin >> s1;
  for (int i = 0; i < n; i++) {
    if (s[i] != s1[i]) {
      int c = s[i] - 'a';
      int c1 = s1[i] - 'a';
      adj[c].push_back(c1);
      adj[c1].push_back(c);
    }
  }
  for (int i = 0; i < 26; i++)
    if (!vis[i]) dfs(i);
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++)
    cout << char(ans[i].x + 'a') << " " << char(ans[i].y + 'a') << '\n';
  return 0;
}
