N=gets.to_i puts N == 2 ? "1 1" : (1..N).permutation(2).filter{|a| a[0]+a[1] == N }.filter{|a| (1..10).cover?(a[0]) && (1..10).cover?(a[1])}[0]