#include <bits/stdc++.h>
inline void writeInt(int n) {
  int N = n, rev, count = 0;
  rev = N;
  if (N == 0) {
    putchar_unlocked('0');
    return;
  }
  while ((rev % 10) == 0) {
    count++;
    rev /= 10;
  }
  rev = 0;
  while (N != 0) {
    rev = (rev << 3) + (rev << 1) + N % 10;
    N /= 10;
  }
  while (rev != 0) {
    putchar_unlocked(rev % 10 + '0');
    rev /= 10;
  }
  while (count--) putchar_unlocked('0');
}
inline void writeLL(long long n) {
  long long N = n, rev, count = 0;
  rev = N;
  if (N == 0) {
    putchar_unlocked('0');
    return;
  }
  while ((rev % 10) == 0) {
    count++;
    rev /= 10;
  }
  rev = 0;
  while (N != 0) {
    rev = (rev << 3) + (rev << 1) + N % 10;
    N /= 10;
  }
  while (rev != 0) {
    putchar_unlocked(rev % 10 + '0');
    rev /= 10;
  }
  while (count--) putchar_unlocked('0');
}
inline void scanInt(int &n) {
  n = 0;
  int ch = getchar_unlocked();
  while (ch < '0' || ch > '9') {
    ch = getchar_unlocked();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar_unlocked();
}
void scanLL(long long &res) {
  res = 0;
  char ch = 0;
  bool neg = false;
  while (ch < 45) ch = getchar_unlocked();
  if (ch == 45) neg = true;
  if (neg) {
    char ch = 0;
    while (ch < '0') ch = getchar_unlocked();
    for (; ch >= '0'; ch = getchar_unlocked()) res = res * 10 + ch - '0';
    res *= (-1);
    return;
  }
  for (; ch >= '0'; ch = getchar_unlocked()) res = res * 10 + ch - '0';
}
using namespace std;
int N;
string A, B;
vector<int> adj[30];
vector<pair<char, char>> sol;
int visti;
int dfs(int nodo, int trova) {
  if (nodo == trova) return true;
  (visti |= (1 << nodo));
  for (int &i : adj[nodo]) {
    if ((visti & (1 << i))) continue;
    if (dfs(i, trova)) return true;
  }
  return false;
}
int main() {
  cin >> N >> A >> B;
  int cont = 0;
  for (int i = 0; i < N; i++) {
    visti = 0;
    int a = A[i] - 'a', b = B[i] - 'a';
    if (!dfs(a, b)) {
      cont++;
      adj[a].push_back(b);
      adj[b].push_back(a);
      sol.push_back({A[i], B[i]});
    }
  }
  cout << cont << '\n';
  for (pair<char, char> &i : sol) {
    cout << i.first << " " << i.second << '\n';
  }
}
