#Python 2, <s>64</s> <s>63</s> 62 bytes <!-- language: lang-py --> def f(n,k,i=1):exec"print[i,'Shaggy'][`k`[:i%k]in`i`];i+=1;"*n