n = int(input()) if n == 1: print("1\n0\n0\n0\n1\n1") elif n == 3: print("012\n345\n345\n225\n141\n300") elif n == 4: print("4551\n3662\n6777\n3005\n3442\n0112") elif n == 5: print("79142\n80653\n80453\n90966\n87754\n11223") elif n == 6: print("022586\n133097\n166600\n244397\n455898\n100667") else: print("-1")