#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long int parent[N], n;
string a, b;
long long int find(long long int x) {
  if (parent[x] == x) {
    return x;
  }
  return parent[x] = find(parent[x]);
}
void merge(long long int u, long long int v) {
  u = find(u);
  v = find(v);
  if (u != v) {
    parent[v] = u;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  cin >> a >> b;
  for (long long int i = 0; i < 26; i++) {
    parent[i] = i;
  }
  vector<pair<char, char>> ans;
  for (int i = 0; i < n; i++) {
    long long int a1 = a[i] - 'a';
    long long int b1 = b[i] - 'a';
    if (find(a1) != find(b1)) {
      merge(a1, b1);
      ans.push_back({a[i], b[i]});
    }
  }
  cout << ((int)(ans).size()) << "\n";
  for (auto it : ans) {
    cout << it.first << " " << it.second << "\n";
  }
  return 0;
}
