#include <bits/stdc++.h>
using namespace std;
long int mod = 1000000007;
const int MAX = 27;
vector<int> parent(MAX), Rank(MAX, 0);
int find(int x) { return (parent[x] == x) ? x : find(parent[x]); }
void unionR(int x, int y) {
  int u = find(x);
  int v = find(y);
  if (Rank[u] == Rank[v]) {
    parent[u] = v;
    Rank[v]++;
  } else if (Rank[u] < Rank[v]) {
    parent[u] = v;
  } else {
    parent[v] = u;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s, t;
  ;
  cin >> s >> t;
  iota(parent.begin(), parent.end(), 0);
  vector<pair<char, char>> ans;
  for (long long i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      int u = find(s[i] - 'a');
      int v = find(t[i] - 'a');
      if (u != v) {
        unionR(u, v);
        ans.push_back({s[i], t[i]});
      }
    }
  }
  cout << ans.size() << '\n';
  for (long long i = 0; i < ans.size(); i++) {
    cout << ans[i].first << ' ' << ans[i].second << '\n';
  }
  return 0;
}
