#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) template bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } void solve(); int main() { cin.tie(nullptr)->sync_with_stdio(false); cout << fixed << setprecision(20); int t = 1; //cin >> t; while (t--) { solve(); } } vectorA(6); int d[6][6]; setst; void solve() { rep(i,6)cin>>A[i]; rep(i,6)rep(j,6)d[i][j]=A[i][j]-'0'; rep(i,1000000){ vectorsum(6); int S=i; rep(j,6){ int cnt=S%10; S/=10; rep(k,6)sum[k]+=d[j][k]*cnt; } rep(k,6)sum[k]%=10; int v=0; rep(k,6)v=10*v+sum[k]%10; st.insert(v); } cout<