#include <bits/stdc++.h>
using namespace std;
std::vector<int> e[100];
bool visited[100];
std::vector<std::pair<int, int> > res;
void dfs(int x) {
  visited[x] = true;
  for (size_t i = 0; i < e[x].size(); ++i)
    if (!visited[e[x][i]]) {
      visited[e[x][i]] = true;
      res.push_back(make_pair(x, e[x][i]));
      dfs(e[x][i]);
    }
}
int main() {
  int n;
  cin >> n;
  std::string a;
  std::string b;
  cin >> a >> b;
  for (size_t i = 0; i < a.size(); ++i) {
    int idx_a = a[i] - 'a';
    int idx_b = b[i] - 'a';
    e[idx_a].push_back(idx_b);
    e[idx_b].push_back(idx_a);
  }
  for (int i = 0; i <= 'z' - 'a'; ++i) {
    if (!visited[i]) dfs(i);
  }
  cout << res.size() << endl;
  for (const auto& p : res) {
    cout << static_cast<char>(p.first + 'a');
    cout << " ";
    cout << static_cast<char>(p.second + 'a');
    cout << endl;
  }
  return 0;
}
