#include <bits/stdc++.h>
using namespace std;
inline long long Max(long long a, long long b) { return a > b ? a : b; }
inline long long Min(long long a, long long b) { return a < b ? a : b; }
inline long long read() {
  long long x = 0;
  int ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') f = -1, ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + ch - '0', ch = getchar();
  return x * f;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10)
    write(x / 10), putchar(x % 10 + '0');
  else
    putchar(x + '0');
}
vector<char> adj[27];
bool vis[27];
vector<pair<char, char>> ans;
void dfs(int id) {
  if (vis[id] == 0) {
    vis[id] = 1;
    for (int i = 0; i < adj[id].size(); i++) {
      if (vis[adj[id][i] - 'a'] == 0) {
        dfs(adj[id][i] - 'a');
        ans.push_back(make_pair(id + 'a', adj[id][i]));
      }
    }
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  char a[n + 1];
  char b[n + 1];
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    a[i] = c;
  }
  a[n] = '\0';
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    b[i] = c;
  }
  b[n] = '\0';
  for (int i = 0; i < n; i++) {
    adj[a[i] - 'a'].push_back(b[i]);
    adj[b[i] - 'a'].push_back(a[i]);
  }
  for (int i = 0; i < n; i++) dfs(a[i] - 'a');
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
