def main():
    N = int(input())
    z = min(N-1, 10)
    print(z, N-z)

if __name__ == '__main__':
    main()