##Java: 151-5 = 146
Golfed:
class A{public static void main(String[]a){int n=new java.util.Scanner(System.in).nextInt();System.out.print(n%4==0?"1":n%4==1?"i":n%4==2?"-1":"-i");}}
Ungolfed:
class A {
public static void main(String[] a) {
int n = new java.util.Scanner(System.in).nextInt();
System.out.print(n % 4 == 0 ? "1" : n % 4 == 1 ? "i" : n % 4 == 2 ? "-1" : "-i");
}
}
Yes, yet another Java reply - and golfed even worse than ever. But you work with what you can...