import java.util.*;


public class Solution {
    /**
     * 旋转字符串
     * @param A string字符串 
     * @param B string字符串 
     * @return bool布尔型
     */
    public boolean solve (String A, String B) {
        // write code here
        if(A.length() != B.length())
            return false;
        A = A + A;
        return A.indexOf(B)>=0?true:false;
    }
}