A non-transitory computer-readable storage medium storing a program that causes a computer, which is included in a relay device that relays communication between a base station device and a terminal device, to:
- relay a predetermined signal transmitted by the base station device through a predetermined beam by outputting the predetermined signal in a plurality of radio wave output directions without decoding user data;
- and
- select an output direction, among the plurality of radio wave output directions, in which to output a radio wave in signal transmission between the terminal device and the relay device, based on a timing at which a second predetermined signal is received from the terminal device,
- wherein in the relay,
- the predetermined signal transmitted through the predetermined beam in a first time slot is relayed in a first direction among the plurality of radio wave output directions, and
- the predetermined signal transmitted through the predetermined beam in a second time slot is relayed in a second direction among the plurality of radio wave output directions.