front and back dp(338,851の該当)