#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n; // номер комнаты
int rooms_per_floor = 1; // кол-во комнат на этаже
int temp = 0;
int rooms = 0; // общее количество комнат
int floor = 0; // этаж, на котором будет находиться комната #n
cin >> n;
while(n>0){
if(rooms_per_floor == temp){
temp = 0;
rooms_per_floor++;
}
else if(n-rooms_per_floor>0){
rooms+=rooms_per_floor;
temp++;
floor++;
n-=rooms_per_floor;
}
else break;
}
cout << floor+1 << " " << n;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkgewoJaW50IG47IC8vINC90L7QvNC10YAg0LrQvtC80L3QsNGC0YsKCWludCByb29tc19wZXJfZmxvb3IgPSAxOyAvLyDQutC+0Lst0LLQviDQutC+0LzQvdCw0YIg0L3QsCDRjdGC0LDQttC1CglpbnQgdGVtcCA9IDA7CglpbnQgcm9vbXMgPSAwOyAvLyDQvtCx0YnQtdC1INC60L7Qu9C40YfQtdGB0YLQstC+INC60L7QvNC90LDRggoJaW50IGZsb29yID0gMDsgLy8g0Y3RgtCw0LYsINC90LAg0LrQvtGC0L7RgNC+0Lwg0LHRg9C00LXRgiDQvdCw0YXQvtC00LjRgtGM0YHRjyDQutC+0LzQvdCw0YLQsCAjbgoJY2luID4+IG47Cgl3aGlsZShuPjApewoJCWlmKHJvb21zX3Blcl9mbG9vciA9PSB0ZW1wKXsKCQkJdGVtcCA9IDA7CgkJCXJvb21zX3Blcl9mbG9vcisrOwoJCX0KCQllbHNlIGlmKG4tcm9vbXNfcGVyX2Zsb29yPjApewoJCQlyb29tcys9cm9vbXNfcGVyX2Zsb29yOwoJCQl0ZW1wKys7CgkJCWZsb29yKys7CgkJCW4tPXJvb21zX3Blcl9mbG9vcjsKCQl9CgkJZWxzZSBicmVhazsKCX0KCWNvdXQgPDwgZmxvb3IrMSA8PCAiICIgPDwgbjsKCXJldHVybiAwOyAKfQ==