# -*- coding: utf-8 -*-
from __future__ import division
a=in(input('digite moedas:))
b=in(input('digite moedas:))
c=in(input('cedulass:))
while c>0:
    if c>=a:
        x=c//a
    if c>=b:
        y=c//b
if c%x==0:
    print(x)
print(y)







04e2fe2af58bb52427f2875d0d9f177c5f0dec96
# -*- coding: utf-8 -*-
from __future__ import division
a=in(input('digite moedas:))
b=in(input('digite moedas:))
c=in(input('cedulass:))
while c>0:
    if c>=a:
        x=c//a
    if c>=b:
        y=c//b
if c%x==0:
    print(x)
print(y)






