#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#define LL long long
using namespace std;
int n, t1, t2;
int gcd(int a, int b) {
return b == 0 ? a : (gcd(b, a%b));
}
int exg(int a, int b) {
return a/gcd(a,b)*b;
}
int main(void) {
//freopen("in.txt", "r", stdin);
while (~scanf("%d%d%d", &n, &t1, &t2)) {
int k = exg(t1, t2), s = k/t1 + k/t2, One = n/s, r = n%s, base = One*k,
Min = 0, cnt = 0, i, j;
if (t1>t2) swap(t1,t2);
//printf("s = %d r = %d\n", s, r);
if (r)
if (i * t1 < j * t2) Min=i*t1, i++, cnt++;
else if(i*t1 > j*t2) Min=j*t2, j++, cnt++;
else Min=j*t2, j++, i++, cnt+=2;
}
printf("%d %d\n", cnt+s*One, base+Min);
}
return 0 ;
}
#include <cstdlib>
#include <cstring>
#include <algorithm>
#define LL long long
using namespace std;
int n, t1, t2;
int gcd(int a, int b) {
return b == 0 ? a : (gcd(b, a%b));
}
int exg(int a, int b) {
return a/gcd(a,b)*b;
}
int main(void) {
//freopen("in.txt", "r", stdin);
while (~scanf("%d%d%d", &n, &t1, &t2)) {
int k = exg(t1, t2), s = k/t1 + k/t2, One = n/s, r = n%s, base = One*k,
Min = 0, cnt = 0, i, j;
if (t1>t2) swap(t1,t2);
//printf("s = %d r = %d\n", s, r);
if (r)
for (i = 1, j = 1; i+j <= s;) {
if (i * t1 < j * t2) Min=i*t1, i++, cnt++;
else if(i*t1 > j*t2) Min=j*t2, j++, cnt++;
else Min=j*t2, j++, i++, cnt+=2;
}
if ( (i-1)*t1!=(j-1)*t2 && Min == (i-1) * t1)
cnt++, Min = max(Min, j*t2);
else if ( (i-1)*t1!=(j-1)*t2 && Min == (j-1) * t2)
cnt++, Min = max(Min, i*t1);
printf("%d %d\n", cnt+s*One, base+Min);
}
return 0 ;
}