output_description: Print the number of times Takahashi will do the action before he is at the
  starting position again.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      X
attempt: a, b, c, d = map(int, input().split())
  dp = [[0 for j in range(d + 1)] for i in range(c + 1)]
  for i in range(a, c + 1):
      for j in range(b, d + 1):
          if i == a and j == b:
              dp[i][j] = 1
              continue
          dp[i][j] = (
              dp[i - 1][j] * j + dp[i][j - 1] * i - dp[i - 1][j - 1] * (i - 1) * (j - 1)
          ) % 998244353
          dp[i][j] += 998244353
          dp[i][j] %= 998244353
  print(dp[c][d])
  
problem_description: Statement
  
  Takahashi is standing on a two-dimensional plane, facing north. Find the
  minimum positive integer K such that Takahashi will be at the starting
  position again after he does the following action K times:
  
    * Go one meter in the direction he is facing. Then, turn X degrees counter-clockwise.
samples: [{"input": "90", "output": "4\n    \n\nTakahashi's path is a square.\n\n* * *"}, {"input": "1", "output": "360"}]