Let $N$ be a six digit number with distinct digits. Find the number $N$ given that the numbers $N$, $2N$, $3N$, $4N$, $5N$, $6N$, when written underneath each other, form a latin square (that is each row and each column contains all six digits).