#include <bits/stdc++.h>
using namespace std;
int pSet[105], n, m1, m2, check1 = 0, x;
string s1, s2;
bool vis[105];
vector<pair<char, char>> edge;
int findSet(int a) {
  if (a == pSet[a])
    return a;
  else
    return findSet(pSet[a]);
}
bool sameSet(int a, int b) {
  if (findSet(a) == findSet(b))
    return 1;
  else
    return 0;
}
void unionSet(int a, int b) { pSet[findSet(a)] = findSet(b); }
void init() {
  for (int i = 0; i <= 26; i++) {
    pSet[i] = i;
  }
}
vector<int> graph[30];
void dfs(int u) {
  vis[u] = 1;
  if (u == x) check1 = 1;
  for (int i = 0; i < graph[u].size(); i++) {
    int v = graph[u][i];
    if (vis[v] == 0) dfs(v);
  }
}
int main() {
  memset(vis, 0, sizeof(vis));
  cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);
  cin >> n;
  cin >> s1 >> s2;
  init();
  for (int i = 0; i < n; i++) {
    if (s1[i] == s2[i]) continue;
    m1 = (int)(s1[i] - 'a');
    m2 = (int)(s2[i] - 'a');
    memset(vis, 0, sizeof(vis));
    check1 = 0;
    x = m2;
    dfs(m1);
    if (check1 == 0) {
      graph[m1].push_back(m2);
      graph[m2].push_back(m1);
      edge.push_back(make_pair(s1[i], s2[i]));
    }
  }
  cout << edge.size() << "\n";
  for (int i = 0; i < edge.size(); i++) {
    cout << edge[i].first << " " << edge[i].second << "\n";
  }
}
