Matching rational numbers