Let q=pn be a power of an odd prime p. We show that the vertices of every graph G can be partitioned into t(q) classes V(G)=⋃t=1t(q)Vi such that the number of edges in any induced subgraph 〈Vi〉 is divisible by q, where t(q)≤32(q−1)−(2(q−1)−1)124+98, and if q=2n, then t(q)=2q−1.In particular, it is shown that t(3)=3 and 4≤t(5)≤5.