#include <stdio.h> int main() { int n; scanf("%d", &n); int sum = 0; int k = 1; while (sum + k <= n) { sum += k; k++; } printf("%d %d", k - 1, sum); return 0; }