x,y,z=map(int,input().split()) for _ in "_"*z: if x