n = int(input()) base = "123" repeat = n // 3 remainder = n % 3 result = base * repeat + base[:remainder] print(result)