#include <bits/stdc++.h>
using namespace std;
const int N = 100006;
int a[26][26] = {};
int n;
char str[2][N] = {};
vector<pair<int, int> > e, ans;
int p[26] = {};
int get_parent(int z) {
  if (p[z] == z) {
    return z;
  }
  p[z] = get_parent(p[z]);
  return p[z];
}
void add_edge(pair<int, int> edge) {
  int p1 = get_parent(edge.first);
  int p2 = get_parent(edge.second);
  if (p1 != p2) {
    p[p2] = p1;
    ans.push_back(edge);
  }
}
int main() {
  scanf("%d%s%s", &n, str[0], str[1]);
  for (int i = 0; i < n; i++) {
    int u = str[0][i] - 'a';
    int v = str[1][i] - 'a';
    if (u != v) {
      if (u > v) swap(u, v);
      if (a[u][v] != 1) {
        a[u][v] = 1;
        e.push_back(make_pair(u, v));
      }
    }
  }
  for (int i = 0; i < 26; i++) {
    p[i] = i;
  }
  for (auto edge : e) {
    add_edge(edge);
  }
  cout << ans.size() << endl;
  for (auto edge : ans) {
    cout << (char)('a' + edge.first) << ' ' << (char)('a' + edge.second)
         << endl;
  }
  return 0;
}
