#include <bits/stdc++.h>
char _;
using namespace std;
unordered_map<char, int> m;
vector<int> adj[27];
vector<char> out1;
vector<char> out2;
int n, ans;
string b, g;
bool vis[27];
void reset() {
  for (int i = 0; i < 27; i++) {
    vis[i] = 0;
  }
}
void dfs(int c) {
  vis[c] = true;
  for (int i = 0; i < adj[c].size(); i++) {
    if (!vis[adj[c][i]]) {
      dfs(adj[c][i]);
    }
  }
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  m['a'] = 1;
  m['b'] = 2;
  m['c'] = 3;
  m['d'] = 4;
  m['e'] = 5;
  m['f'] = 6;
  m['g'] = 7;
  m['h'] = 8;
  m['i'] = 9;
  m['j'] = 10;
  m['k'] = 11;
  m['l'] = 12;
  m['m'] = 13;
  m['n'] = 14;
  m['o'] = 15;
  m['p'] = 16;
  m['q'] = 17;
  m['r'] = 18;
  m['s'] = 19;
  m['t'] = 20;
  m['u'] = 21;
  m['v'] = 22;
  m['w'] = 23;
  m['x'] = 24;
  m['y'] = 25;
  m['z'] = 26;
  cin >> n;
  cin >> b >> g;
  for (int i = 0; i < b.size(); i++) {
    if (b[i] != g[i]) {
      reset();
      dfs(m[b[i]]);
      if (!vis[m[g[i]]]) {
        ans++;
        adj[m[b[i]]].push_back(m[g[i]]);
        adj[m[g[i]]].push_back(m[b[i]]);
        out1.push_back(b[i]);
        out2.push_back(g[i]);
      }
    }
  }
  cout << ans << "\n";
  for (int i = 0; i < ans; i++) {
    cout << out1[i] << " " << out2[i] << "\n";
  }
}
