Solved by 210 users: ...
UserDateAttemptTimeCMSC
sb3ar`23 apr 2008`Ruby100.02119
deCart`30 oct 2006`FPC100.01124
topspin`12 jun 2009`Kylix200.02128
topspin`12 jun 2009`Kylix300.02128
topspin`14 jun 2009`Kylix500.02128
Romka`03 mar 2008`FPC100.02131
evg281`15 may 2010`Perl100.06138
bush`09 mar 2006`Ruby200.02145
georgy`23 aug 2006`Perl200.07153
grenkin`30 aug 2005`Kylix1?.??154
bush`07 mar 2006`Ruby100.02157
Zhomart`21 oct 2006`FPC100.01158
Aydar`04 nov 2006`Kylix100.01158
 C++ 123 FPC 32 C 20 Kylix 18 Java 12 Ruby 3 Perl 2 Scheme 1 Python 1
` >  >  >  >  >  >  >  >  >  > `

## Fraction

Time limit = 5 second(s)

Memory limit = 8 Mb

The language to write down fractions consists of one simple rule.
`{a}/{b}`
means a fraction, with numerator "a" and denominator "b". Spaces are not allowed in this language.
In order to represent this fraction in text mode with fixed character width, the fraction line is build up from "minus" characters and placed in such way, that numerator is completely above and denumerator — completely below the line. The numerator and denumerator should be placed according to this rule in such way, that the dimensions of the resulting fraction representation are minimal possible. Then two additional "minuses" are added to the fraction line — one on the left and one on the right.
For example, the fraction
`{2m}/{{n}/{q}}+{{x}/{y}}/{z+1}`
Has the following representation
```        x
---
2m     y
-----+-----
n    z+1
---
q
```
The dimensions of fraction is this example are 11x7 characters.
Your task is to determine the horizontal and vertical size of the resulting fraction. You don't need to construct the fraction representation itself.

Input The first and only line contains the string with fraction specifiction. The length of te string does not exceed 50 characters.

Output Two numbers separated by one or more spaces — the width and height of the fraction in characters respectively.

 Input#1```a ``` Output#1```1 1 ```
 Input#2```{2m}/{{n}/{q}}+{{x}/{y}}/{z+1} ``` Output#2```11 7 ```
 Input#3```{aa+bb+cc}/{3} ``` Output#3```10 3 ```

Author:
Korolev Dmitry
2 april 2004

 © acm.mipt DevGroupThe page was generated in 210ms