#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
int n;
string a, b;
int uf[27];
int find(int cur) { return uf[cur] == cur ? cur : uf[cur] = find(uf[cur]); }
void merge(int a, int b) { uf[find(a)] = find(b); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  iota(uf, uf + 27, 0);
  cin >> n >> a >> b;
  vector<pair<char, char>> sol;
  for (int i = 0; i < n; i++) {
    if (find(a[i] - 'a') != find(b[i] - 'a')) {
      sol.push_back({a[i], b[i]});
      merge(a[i] - 'a', b[i] - 'a');
    }
  }
  cout << sol.size() << '\n';
  for (const auto& p : sol) cout << p.first << " " << p.second << '\n';
  return 0;
}
