#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int N = 30, oo = 2e9, md = 1e9 + 7;
bool mas[N][N], use[N];
set<char> s;
vector<pair<char, char>> ans;
void dfs(int k) {
  if (use[k]) return;
  use[k] = 1;
  for (int i = 0; i < N; ++i) {
    if (mas[k][i]) dfs(i);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  int n;
  string s1, s2;
  cin >> n >> s1 >> s2;
  for (int i = 0; i < n; ++i) {
    memset(use, 0, N);
    int a = s1[i] - 'a', b = s2[i] - 'a';
    dfs(a);
    if (!use[b]) {
      mas[a][b] = 1;
      mas[b][a] = 1;
      ans.push_back({a + 'a', b + 'a'});
    }
  }
  cout << ans.size() << endl;
  for (auto x : ans) cout << x.first << ' ' << x.second << endl;
  return 0;
}
