1647

Problem ID: 1647

See also: SPOJ M00PAIR