#include <bits/stdc++.h>
using namespace std;
void dfs(int u, vector<int> *adj, vector<int> &visited,
         vector<pair<int, int> > &out) {
  visited[u] = 1;
  for (auto v : adj[u]) {
    if (!visited[v]) {
      out.push_back({u, v});
      dfs(v, adj, visited, out);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  vector<int> adj[50];
  for (int i = 0; i < n; i++) {
    int u = s1[i] - 'a', v = s2[i] - 'a';
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  vector<int> visited(30, 0);
  vector<pair<int, int> > out;
  for (int i = 0; i <= 26; i++) {
    if (!visited[i]) {
      dfs(i, adj, visited, out);
    }
  }
  cout << out.size() << "\n";
  for (int i = 0; i < out.size(); i++) {
    cout << (char)(out[i].first + 'a') << " " << (char)(out[i].second + 'a')
         << "\n";
  }
  return 0;
}
