#include <bits/stdc++.h>
using namespace std;
vector<int> arr[1000001];
bool vis[27];
vector<pair<int, int> > res;
void dfs(int node) {
  vis[node] = true;
  for (int child : arr[node]) {
    if (!vis[child]) {
      res.push_back({node, child});
      dfs(child);
    }
  }
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  string s1, s2;
  cin >> n;
  cin >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    if (s1[i] != s2[i]) {
      arr[s1[i] - 96].push_back(s2[i] - 96);
      arr[s2[i] - 96].push_back(s1[i] - 96);
    }
  }
  for (int i = 1; i < 27; i++) {
    if (!vis[i]) {
      dfs(i);
    }
  }
  cout << res.size() << endl;
  for (pair<int, int> e : res) {
    cout << char(e.first + 96) << " " << char(e.second + 96) << endl;
  }
  return 0;
}
