import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main
(String[] args
) { Scanner scanner
= new Scanner
(System.
in);
int n, m;
n = scanner.nextInt();
m = scanner.nextInt();
for (int i = 0; i < n; i++) {
g[i] = new ArrayList<>();
}
for (int i = 1; i <= m; i++) {
// Taking input for an undirected graph.
int x, y;
x = scanner.nextInt();
y = scanner.nextInt();
g[x].add(y);
g[y].add(x);
}
for (int i = 0; i < n; i++) {
int c = g[i].size();
System.
out.
println(i
+ " " + c
); }
}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKIApwdWJsaWMgY2xhc3MgTWFpbiB7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgU2Nhbm5lciBzY2FubmVyID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKIAogICAgICAgIGludCBuLCBtOwogICAgICAgIG4gPSBzY2FubmVyLm5leHRJbnQoKTsKICAgICAgICBtID0gc2Nhbm5lci5uZXh0SW50KCk7CiAKICAgICAgICBBcnJheUxpc3Q8SW50ZWdlcj5bXSBnID0gbmV3IEFycmF5TGlzdFtuXTsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgICAgICBnW2ldID0gbmV3IEFycmF5TGlzdDw+KCk7CiAgICAgICAgfQogCiAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gbTsgaSsrKSB7CiAgICAgICAgICAgIC8vIFRha2luZyBpbnB1dCBmb3IgYW4gdW5kaXJlY3RlZCBncmFwaC4KICAgICAgICAgICAgaW50IHgsIHk7CiAgICAgICAgICAgIHggPSBzY2FubmVyLm5leHRJbnQoKTsKICAgICAgICAgICAgeSA9IHNjYW5uZXIubmV4dEludCgpOwogICAgICAgICAgICBnW3hdLmFkZCh5KTsKICAgICAgICAgICAgZ1t5XS5hZGQoeCk7CiAgICAgICAgfQogCiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgaW50IGMgPSBnW2ldLnNpemUoKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGkgKyAiICIgKyBjKTsKICAgICAgICB9CiAgICB9Cn0=