The present invention relates to a compound represented by the formula (I), a salt thereof, an N-oxide form thereof, a solvate thereof, or a prodrug thereof, and a medicament containing the same. The compound represented by the formula (I) has an ability to bind to an S1P receptor (particularly, EDG-1, EDG-6, and/or EDG-8) and is useful for preventing and/or treating for rejection to transplantation, graft-versus-host disease, autoimmune diseases, allergic diseases, neurodegenerating diseases, and the like. wherein all symbols are described in the specification.