#include<iostream>
using namespace std;
int main(){
const int N=;
int count;
count=;
for(int i=;i<=N;i++)
for(int j=;j<=N;j++)
if(j==i)
continue;
else
for(int k=;k<=N;k++)
if(k!=j&&k!=i)
{
cout<<i<<j<<k<<endl;
count++;
}
cout<<count<<endl;
return ;
}