#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> ans;
void dfs(vector<int> adj[], int visited[], int start) {
  visited[start] = 1;
  for (int j = 0; j < adj[start].size(); j++) {
    if (visited[adj[start][j]] == 0) {
      ans.push_back(make_pair(start, adj[start][j]));
      dfs(adj, visited, adj[start][j]);
    }
  }
}
int main() {
  int n;
  cin >> n;
  char s1[n + 1];
  char s2[n + 1];
  cin >> s1 >> s2;
  vector<int> adj[26];
  for (int i = 0; i < n; i++) {
    if (s1[i] != s2[i]) {
      adj[s1[i] - 'a'].push_back(s2[i] - 'a');
      adj[s2[i] - 'a'].push_back(s1[i] - 'a');
    }
  }
  int visited[26];
  for (int i = 0; i < 26; i++) visited[i] = 0;
  for (int i = 0; i < 26; i++) {
    if (visited[i] == 0) dfs(adj, visited, i);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << char('a' + ans[i].first) << " " << char('a' + ans[i].second)
         << endl;
}
